Analogy is used to treat the system of non-interacting integrate-and-fire neurons as an ideal Fermi gas. It allows to obtain the nonlinear gain curve in the form of sigmoid in agreement with biological findings. As the by-product the gain-threshold mechanism in neurons is presented. Surprisingly enough, this is in agreement with new biological findings, too. Besides, the application of this mechanism to the dynamics of neurons leads to the non-monotone transfer function.