Ideological and Political Education of Ecological Civilization (IPE-EC) has been increasingly integrated into Environmental Science education in China; however, quantitative evidence on its relationship with students’ academic performance remains limited. This study investigated the longitudinal association between IPE-EC implementation and academic performance and identified key contributing factors. A longitudinal observational study was conducted among 156 Environmental Science postgraduates from 2018 to 2023 using annual questionnaire and academic record data. IPE-EC was evaluated by average exposure time (AT), curriculum exposure (CU), recognition of ecological civilization concepts (RE), and willingness to engage in environmental protection behavior (WEB); academic performance by overall Grade Point Average (GPA-A), core-course GPA (GPA-C), publication activity, and academic activity participation. Multiple stepwise linear regression, machine learning, Shapley Additive Explanations (SHAP), and coupling coordination analysis were employed. This association strengthened over time. In 2023, GPA-A was positively correlated with CU (r = 0.342, p < 0.05), and WEB with AT, CU, and RE (r = 0.355, 0.414, and 0.526, respectively). The MSLR models achieved R2 of 0.62–0.78, and the gradient boosted regression tree model showed the highest cross-validated performance (mean R2 = 0.88). SHAP analysis identified RE, CU, and AT as the major contributors. From 2018 to 2023, the coupling coordination linking IPE-EC with academic attainment rose by 0.20, moving from 0.58 to 0.78. These findings provide quantitative evidence that IPE-EC is associated with academic performance through complex nonlinear interactions among ecological cognition, curriculum exposure, and learning-related factors, highlighting the value of integrating ecological civilization education with disciplinary learning.