This work is based on an analysis of the spatial trends and drivers of soil C, N, and P contents and their stocks in relation to latitude, longitude, and altitude. For this purpose, the coniferous forests of Qinghai spruce (Picea crassifolia (Pc)) and Qilian juniper (Juniperus przewalskii (Jp)) within the Qilian Mountains in northwest China were selected as the objects of research. It was found that at the regional scale, the C and N contents in soil from the Pc forests were 1.34 and 1.17 folds higher than those of the Jp forests, respectively, whereas the P content was 0.92 fold lower than that of the Jp forests. Interestingly, the stock of soil C and N in the two forests was consistent, indicating an equivalent role of both in maintaining the regional C and N stocks. Secondly, the soil C and N stocks of Jp were the highest at a low altitude (< 2800 m), which indicated that the Jp forest trees retained high amounts of C and N at an altitude < 2800 m. In addition, the stocks of soil C and N correlated negatively with the latitude and positively with the longitude (P < 0.05). A partial redundancy analysis and random forests regression models showed that the stocks of soil C, N, and P were primarily controlled by the soil properties, particularly the bulk density and nutrient contents. Overall, these results provide insights into the effects of soil and terrain factors on soil C, N, and P stock, thereby providing a foundation for targeted forest conservation and rehabilitation in the Qilian Mountains in the future.