Green innovation is a new driving force to promote green and low-carbon development. Whether an energy transition strategy can induce green innovation is an important question that has not been clearly answered. With the help of panel data from 281 cities in China during 2007–2021, this study considers China’s new energy exemplary city policy as a quasi-natural experiment and conducts a difference-in-differences model to explore the effects and mechanisms of energy transition strategy on urban green innovation. The results show that a new energy exemplary city effectively induces urban green innovation, with mediating mechanisms of increasing government financial support, promoting human capital agglomeration, and improving energy efficiency. The moderating mechanisms test reveals that environmental regulation and intellectual property protection play a positive moderating role in the promotion of green innovation through the new energy exemplary city policy. Heterogeneity analysis suggests that the new energy exemplary city policy has a stronger effect on promoting green innovation in eastern regions and non-resource-based cities. Our findings not only enrich our understanding of the relationship between energy transition strategy and green innovation but also provide a reference for policymakers to promote energy transition and green innovation.