The impact of environmental, social, and governance (ESG) performance gaps on firm green innovation is examined in this paper by a panel database of A-share Chinese listed companies from 2011 to 2021. Using multiple linear regression and conducting a series of endogeneity tests and robustness checks, our empirical analysis shows that firm ESG performance gaps have significantly positive effect on green innovation. Both ESG performance below historical aspiration and social aspiration levels enhance a firm’s green innovation. Confucian culture negatively moderates the positive relationship between ESG performance gaps and green innovation, suggesting that firms more influenced by Confucian culture exhibit reduced green innovation than those less influenced. Additionally, firm digitalization positively moderates the positive relationship between ESG performance gaps and green innovation, indicating that firms with higher levels of digitalization are better equipped to improve green innovation when facing ESG performance shortfalls. This study extends the existing knowledge of firm ESG performance and motivation of green innovation. The research findings offer practical insights for leveraging the motivation and capabilities of green innovation to attain firm ESG objectives.