Forest–wetland ecotones are transitional ecosystems characterized by pronounced hydrological and biogeochemical heterogeneity, yet the microbial mechanisms regulating nutrient cycling in these zones remain insufficiently understood. This study investigated how vegetation transitions across a forest–wetland ecotone in the black-soil region of Northeast China shape soil microbial communities and nitrogen–cycling functions. Soils were collected from four vegetation types: mixed forest (MF), coniferous forest (CF), wetland edge (WE), and natural wetland (NW). Quantitative PCR was used to quantify key nitrogen–cycling functional genes (nifH, amoA, amoB, norB, nosZ), and PICRUSt2 was applied to predict microbial functional potentials. Forest soils (MF and CF) exhibited higher microbial diversity, stronger network connectivity, and greater abundances of nifH and amoA, indicating enhanced nitrogen fixation and nitrification under oxic conditions. In contrast, wetland soils harbored denitrification-enriched communities with higher norB and nosZ abundances but lower diversity. The WE vegetation type acted as a functional hotspot where alternating oxic–anoxic conditions facilitated the coexistence of nitrifiers and denitrifiers, thereby enhancing carbon–nitrogen coupling and functional resilience. Redundancy and Mantel analyses identified soil organic carbon, total nitrogen, water content, and enzyme activities as major environmental drivers of microbial structural and functional variation. This study reveals that vegetation transitions reorganize microbial community assembly and nitrogen-cycling functions through hydrological and biogeochemical heterogeneity, providing mechanistic insights into nutrient turnover and ecological regulation in black-soil ecotones.