X-ray absorption near-edge spectroscopy (XANES), photoluminescence, cathodoluminescence and Raman spectroscopy have been used to investigate the chemical states of nitrogen dopants in ZnO nanowires. It is found that nitrogen exists in multiple states: NO, NZn and loosely bound N2 molecule. The work establishes a direct link between a donor-acceptor pair (DAP) emission at 3.232 eV and the concentration of loosely bound N2. These results confirm that N2 at Zn site is a potential candidate for producing a shallow acceptor state in N-doped ZnO as theoretically predicted by Lambrecht and Boonchun [Phys. Rev. B 87, 195207 (2013)]. Additionally, shallow acceptor states arising from NO complexes have been ruled out in this study.