Peat-based substrates have been widely used in greenhouse vegetable production (GVP). However, peat is a non-renewable resource, and there is a problem with N2O emissions when it is used in greenhouse vegetable production due to the application of large quantities of nutrient solutions. Sphagnum (SP) is a precursor substance and a renewable resource for peat formation, and it has good physical and chemical properties. However, there has been no study on the effect of using sphagnum to replace peat in greenhouse vegetable production on N2O emissions. Therefore, this study used a peat substrate as the control treatment (CK), with sphagnum replacing peat at 25% (25SP), 50% (50SP), 75% (75SP), and 100% (100SP) in six treatment groups. Moreover, lettuce was used as the experimental subject in potting experiments, and the physicochemical properties, N2O emissions, N2O isotope δ value, and N2O-related microbial activity and community structures were determined using different treatments. Compared with the CK treatment, the 25SP treatment significantly reduced N2O emissions by 55.35%, while the 75SP treatment significantly increased N2O emissions by 67.76%. The 25SP treatment reduced N2O to N2 to the highest extent and demonstrated the lowest contribution of fungal denitrification (FD) and bacterial nitrification (BN) processes, thereby resulting in lower N2O emissions. In contrast, NH4+ and NO3− were the main substrates for N2O emissions; the 75SP treatment had higher NH4+ and NO3− contents and a lower relative abundance of the nosZ gene, thereby resulting in higher N2O emissions. In addition, N2O production and reduction were dominated by bacterial denitrification for all treatments. Thus, this study analyzed the community composition of denitrifying bacterial genera and their association with physicochemical properties. The results indicated that the dominant denitrifying genus in the peat substrate was Rhodanobacter and that sphagnum replacement reduced the relative abundance of Rhodanobacter. The dominant genus was Massilia at 100% sphagnum replacement. More importantly, Rhodanobacter was correlated with C/N and electrical conductivity (EC), whereas Massilia was affected by NH4+ and the water-filled pore space (WFPS). Therefore, different denitrification-dominant genera were affected by different environmental factors, which indirectly affected N2O emission. In summary, the 25SP treatment was able to improve nitrogen use efficiency and had no significant effect on lettuce yield. Therefore, 25% sphagnum replacement is the most suitable percentage for peat replacement.