In this report, we developed a unified and standardized one-pot sequence that converts pyridine derivatives into 1,2-diazepines by inserting a nitrogen atom. This skeletal transformation capitalizes on the in situ generation of 1-aminopyridinium ylides, which rearrange under UV light irradiation. A thorough evaluation of the key parameters (wavelength, reaction conditions, activating agent) allowed us to elaborate on a simple, mild, and user-friendly protocol. The model reaction was extrapolated to more than 40 examples, including drug derivatives, affording unique 7-membered structures. Mechanistic evidence supports the transient presence of a diazanorcaradiene species. Finally, pertinent transformations of the products, including ring contraction reactions to form pyrazoles, were conducted and paved the way to a broad application of the developed protocol.