The complementarity effect (CE) that leads to more efficient utilization of resources has been invoked to explain the biodiversity-ecosystem functioning (BEF) relationships. Dinitrogen (N2) fixation by legumes is a widely-accepted pathway to enhance N acquisition in diverse species communities. However, the relationships among positive CE, N2 fixation, and soil N cycling are still poorly understood, especially in agroecosystems. This study tested the hypothesis that positive CE enhances nitrogen (N) acquisition, driven by increased N2 fixation of legumes and enhanced soil N cycling in intercropping systems. We used a long-term (12 years) field experiment of maize intercropped with both legumes (faba bean, chickpea, and soybean) and a non-legume (oilseed rape) under three phosphorus application rates and a meta-analysis, to explore the main processes for a positive CE of N acquisition in intercropping. Intercropping increases grain yield and N acquisition compared with monocultures, with an increase of 35.1% and 28.0% of the average annual yield and N acquisition, respectively. This N acquisition gain (72 kg N ha−1 in field studies and 14 kg N ha−1 in a meta-analysis) was largely due to the complementarity effect (65 kg N ha−1 in field studies and 25 kg N ha−1 in the meta-analysis), which was significantly correlated with enhanced N2 fixation in legume-based intercropping systems, in both field studies and the meta-analysis. After 12 years, the soil N concentration of intercropping systems was 4.0–6.3% higher than that of monocultures as a result of enhanced N2 fixation and N-acquiring enzyme activities, which accounted for positive complementarity in both legume-based and non-legume-based systems. However, those benefits were only observed in later years. We provide a novel mechanism that a positive feedback effect of crop diversity on soil fertility enhances CE over time. Our study demonstrates that enhanced CE is related to N2 fixation by legumes and a positive feedback effect of crop diversity on soil fertility which highlights that increasing soil N cycling aided by crop diversity may strengthen BEF relationships and enhance grain yield on a decadal scale. These findings have important implications that introducing legumes into managed ecosystems (e.g., cropland, pastures, or agroforestry) or selecting species combinations with different functional groups when designing crop diversity ecosystems are promising approaches to establishing productive and sustainable managed ecosystems.