N-nitroglycine (NNG), a rare nitramine natural compound, is the only known example produced by streptomyces strains. In this study, we clarified that NNG biosynthesis originates from glycine and l-lysine and elucidated its biosynthetic gene cluster (BGC) nng. This cluster shares high homology with the recently reported BGCs of diazo compound azaserine. In vivo and in vitro results have indicated NNG biosynthetic pathway involves hydrazine and hydrazone generation, with a non-heme diiron N-oxygenase and a cytochrome P450 responsible for forming the nitramine structure. Furthermore, although NNG lacks a serine unit in the structure, its biosynthesis still requires the incorporation of a serine attached to the hydrazone intermediate by non-ribosomal peptide synthetase (NRPS), similar to the azaserine pathway, and two hydrolases are putatively involved in thioester hydrolysis and serine removal, respectively. This study, along with comparisons to azaserine biosynthesis, not only paves the way for the discovery of new nitramine and diazo compounds by genome mining but also highlights the potential for uncovering novel enzymes and chemistry involved in hydrazone oxidation.