The potential of sulphur (S), MgSO4 (Mg), and KH2PO4 (P) in nitrogen retention, ammonia emission decrease, and microbial community succession during composting needs to be investigated. To achieve this, different levels of S (0, 0.2, 0.4, 0.6, and 0.8% in dry weight) plus Mg and P (S + Mg + P) were progressively added in 70 days pig manure aerobic composting. The results revealed that the amendment increased salinity and lowered pH and dephytotoxication of the product with the increase of S amount. However, no significant inhibition effects were observed on the evolution of the thermophilic phase and product maturity. In addition, the amendment significantly reduced the total NH3 and N2O emissions by 29.66%–58.81% and 20.6%–56.7%, increased NH4+ level by 17.22%–73.21% in thermophilic phase and NO3− content by 26.17%–57.48% in a mature phase, and elevated the total Kjeldahl nitrogen content by 34.28%–46.6% during the composting. In addition, compared to the control, the supplement markedly encouraged the formation of guanite in the compost product. The S addition stimulated the growth of Anseongella, Actinomadura, Chelativorans, Castellaniella, Luteimonas, and Steroidobacter microbial communities which functioned well in the degradation of nitrogen-containing compounds and organic matter. Evidence from Redundancy Analysis, Firmicutes, Myxococcus, Chloroflexi, Gemmatimonadota, and Deinococcota showed positive correlations with pH. These results imply that adding S–Mg–P amendment encourages the population and activity of specific functional microorganisms, and facilitated the ammonia emission reduction by lowering pH and thus reserved nitrogen through the formation of guanite during composting. The investigation of bacterial community abundance and environmental variables at the phylum and genus levels over time revealed that adding of 0.6% S in conjunction with P and Mg minerals was suitable for nitrogen loss mitigation in composting. The findings suggest using S + Mg + P supplement to conserve nitrogen in pig dung aerobic composting.