This study explores the effects of afforestation in infertile mountainous areas on soil microbial communities and functional nutrient cycling genes in young Cyclobalanopsis gilva forests, aiming to provide a scientific basis for promoting C. gilva growth. Employing metagenomic sequencing coupled with integrative analyses of microbial community structure and functional genes, this study took 7-year-old C. gilva forest stands in infertile mountainous areas of Shouchang Forest Farm, Zhejiang Province as the research object, using adjacent 7-year-old C. gilva forest in woodland areas as a control, to analyze the differences in soil microbial community structure and nutrient cycling functional genes in the rhizosphere (SCG) and non-rhizosphere (SNR) of infertile mountainous areas, as well as from the rhizosphere (FCG) and non-rhizosphere (FNR) of control woodland areas, and further explore their relationships with the growth of C. gilva. The results indicated that the contents of soil organic carbon (SOC), total nitrogen (TN), total phosphorus (TP), and microbial biomass nitrogen (MBN) in SNR were significantly lower than those in FNR by 59.50%, 39.57%, 29.32%, and 53.13%, respectively. Bradyrhizobium and Trebonia were the dominant genera in both site conditions; however, the relative abundance of these genera was lower in infertile mountainous areas compared to the control. Notably, the Shannon and Simpson indices of SCG were significantly lower by 0.49 and 0.01 than those of SNR (p < 0.05), respectively. Additionally, the relative abundances of carbon fixation and nitrogen fixation of SCG were significantly higher than those of SNR. And the relative abundances of functional genes involved in carbon cycling (glyA, fdhA), nitrogen cycling (nasA, narfC, narC, and nirB), and phosphorus cycling (phoB) in infertile mountainous areas were significantly higher than those in the control. The nutrient cycling processes and the expression of functional genes in SCG are coordinately regulated by soil nutrients (SOC and TN) and microbial biomass [MBC (microbial biomass carbon) and MBN]. This work provides a mechanistic foundation for optimizing afforestation strategies and ecological restoration in nutrient-limited mountainous ecosystems, highlighting the critical role of microbial functional plasticity in overcoming edaphic constraints.