Lithology has such an important effect on the sustainability of soil carbon (C) pools. Forests are an important part of terrestrial C sinks; yet, it is unclear whether their soil carbon sensitivity to temperature changes is regulated by lithology, especially in karst ecosystems, which are widely distributed globally. Along a climate gradient in the subtropical region of southwest China, we compared the contents of soil organic C (SOC) and total N (TN) in karst and non-karst forests. The data were analyzed and processed using ANOVA, regression analysis, and random forest. The results showed that the karst forests had significantly higher SOC and TN contents but lower ratio of SOC to TN (C:N) than non-karst forests, mainly because of the higher soil calcium (Ca) content and microbial biomass. With rising mean annual temperature (MAT), SOC and TN contents in non-karst forests significantly decreased, whereas in karst forests they were not correlated with MAT; while, the opposite was true for C:N. In karst forests, soil Ca constrain warming induced decomposition of SOC and TN by forming stable complexes with SOM through exchangeable Ca, and by promoting aggregate stability through the role of calcium carbonate. The correlation between δ13C and the logarithm of SOC concentration also supported that conclusion. In karst forests compared to non-karst forests, soil C pools are larger and less sensitive to regional temperature change. Nevertheless, climate warming may still accelerate soil C loss in karst forests by increasing microbial C limitation. Thus, soil C sequestration potential and loss risk coexist in karst areas. The ratio of SOC to TN (C:N) is regulated through appropriate management measures in the process of karst vegetation restoration, thus promoting long-term stable sequestration of soil carbon pools.