Irrigation and fertilization are important ways to achieve the “carbon neutral” of farmland, but the relative importance of their contribution to the soil carbon stock remains unclear. In this paper, a long-term experiment (from 2012 to 2021) with six N fertilizers and three levels of drip irrigation was conducted to evaluate soil organic carbon stock (SOCs), absolute SOCS (ΔSOCS), and relative SOCS ratio (SOCs-ratio). The six N levels were N0 (0 kg·ha−1 pure N), N120 (120 kg·ha−1 pure N), N180 (180 kg·ha−1 pure N), N240 (240 kg·ha−1 pure N), N300 (300 kg·ha−1 pure N), and N360 (360 kg·ha−1 pure N), respectively. The three irrigation levels were 45 mm (sufficient irrigation, F), 36 mm (moderate deficit irrigation, M), and 27 mm (severe deficit irrigation, S). The results indicated that long-term nitrogen application increased the SOCS by 3.18%− 34.46%, while long-term non-nitrogen (N0) application consumed the soil carbon stock. The SOCs increased with the increase in nitrogen application rate, but the soil carbon fixation capacity was weakened when the application of the N amount exceeds 300 kg·ha−1. Compared with the 45 mm irrigation level, irrigation with 36 mm and 27 mm increased the SOCS by 15.70%− 34.46%, which improved the carbon fixation capacity of farmland soil with N180-N240. The 0–40 cm soil layer contributed nearly 60% of the SOC, and soil moisture and water-nitrogen synergy explained 81.77% of the changes in soil carbon stock, where soil moisture had a negative effect on carbon stock, and water-nitrogen synergy had a positive effect on carbon stock. The soil C/N ratio was 10.35–12.00, among which the mineralized nitrogen content in the soil with N300-N360 was relatively high, indicating that there was a serious shortage of carbon stock and carbon emission driving in the farmland in the North China Plain.