In the context of the digital economy, digital technology is an important driving force to promote green development and achieve the “dual-carbon goal”. Taking 1746 Shanghai and Shenzhen A-share enterprises from 2015 to 2022 as research objects, we empirically examine the relationship between government subsidies, digital transformation, and corporate green technology innovation. The study shows that (1) there is an inverted “U”-shaped relationship between government subsidies and corporate green technological innovation, while digital transformation plays a mediating role, and there is a difference between the quality and quantity of digital transformation in promoting green technological innovation. (2) Through the analysis of the moderating effect, it is found that market concentration has an obvious inhibitory effect between enterprise digital transformation and green technology innovation. (3) The study, by classifying the nature of enterprises, shows that the promotion effect of digital transformation on green technology innovation is weaker under heavily polluted enterprises than under non-heavily polluted enterprises, but the promotion interval of the relationship between government subsidies and green technology innovation is larger. Therefore, enterprises should make full use of digital technology to inject new impetus into their innovation activities, and the government should fully consider the appropriate space for enterprises to receive subsidies, make reasonable use of the incentive effect of government subsidies, and smooth the information docking channels for government and enterprise subsidies.