Penta-NiN 2 is a two-dimensional layered material with pentagonal atomic arrangement and has recently been manufactured in experiments (ACS Nano 2021, 15, 8, 13539). We study systematically the adsorption of CO, CO 2 , NO, NO 2 , NH 3 , and CH 4 on penta-NiN 2 nanosheet and its effects on electronic properties employing the first-principles method combined with the nonequilibrium Green's function. Excellent sensing performance of penta-NiN 2 is predicted for the NO x (x = 1, 2) molecules based on energetic, geometric, and electric analyses. The adsorption of NO and NO 2 gas molecules may convert penta-NiN 2 from a nonmagnetic semiconductor to magnetic metal. A current enhancement around 800% can be observed in penta-NiN 2 connected to a circuit after its adsorption of NO. The unique selectivity and sensitivity to adsorption suggest that penta-NiN 2 may become a widely used gas sensor for NO and NO 2 .