To achieve the 'carbon peaking and carbon neutrality' objectives, there has been a growing interest in corporate environmental, social, and governance (ESG) performance from governmental and supervisory bodies. This heightened focus has posed critical theoretical and practical questions on how firms can enhance their ESG performance to facilitate their transition to a green economy. From a stakeholder perspective, this study examines data from 724 listed Chinese companies spanning 2015-2021. It aims to elucidate the relationship between benefit drivers (such as media attention, financing constraints, and government subsidies) and corporate ESG performance, along with investigating the mediating role of green technology innovation and the moderating influence of peer pressure in this context. The findings suggest that both media attention and government subsidies positively correlate with ESG performance, while financing constraints exhibit a negative correlation. Moreover, green technology innovation serves as a mediator between benefit drivers and corporate ESG performance. Furthermore, peer pressure can serve as a positive moderator in the relationship between media attention and green technology innovation, as well as in the negative relationship between financing constraints and green technology innovation. Conversely, it can negatively moderate the positive relationship between government subsidies and green technology innovation. Heterogeneity analysis reveals that in enterprises with superior resource acquisition capabilities, benefit drivers exert a more pronounced influence on corporate ESG performance. Similarly, in state-owned enterprises, benefit drivers also have a heightened impact on corporate ESG performance.