We address the secure control issue of networked non-affine nonlinear systems under denial of service (DoS) attacks. As for the situation that the system information cannot be measured in specific period due to the malicious DoS attacks, we design a neural networks (NNs) state observer with switching gain to estimate internal states in real time. Considering the error and dynamic performance of each subsystem, we introduce the recursive sliding mode dynamic surface method and a nonlinear gain function into the secure control strategy. The relationship between the frequency (duration) of DoS attacks and the stability of the system is established by the average dwell time (ADT) method. It is proven that the system can withstand the influence of DoS attacks and track the desired trajectory while preserving the boundedness of all closed-loop signals. Finally, simulation results are provided to verify the effectiveness of the proposed secure control strategy.