Due to the lack of specific shapes and textures and susceptibility to background clutter and noise interference, infrared small target detection has always been a challenging task. The nonlinear spiking neural P (NSNP) system is a type of neural computing model inspired by the nonlinear spiking mechanisms of biological neurons. It can better identify the internal relationships between small objects, and based on this. This paper presents a variant of NSNP systems, called nonlinear spiking neural P systems with two states or NSNP-TS systems. Based on this variant, a new method for infrared small target detection is proposed. The core idea is the employment of the nonlinear spiking mechanism of the NSNP-TS system. Moreover, a preprocessing component is introduced to find potential targets from the original infrared image, with the aim of making the firing mechanism of the NSNP-TS system more effective. The experimental results on real sequences from 8 different environmental backgrounds indicate that the proposed method outperforms other comparative methods.