While pursuing sustainable growth there is a need to inculcate the procedure of a sustainable environment for coming generations. This study investigates the association between carbon dioxide emissions (CO2) and gross domestic product (GDP), disaggregate and aggregate energy usage, trade, using yearly data for the time component of 1980–2019 for D-8 and G-7 countries. The study employs second-generation unit root tests namely cross sectionally augmented Dickey Fuller (CADF) and cross sectionally augmented IPS (CIPS). Further, Kao, Pedroni, and Westerlund cointegration tests are employed to test for cointegration. To estimate models, fully modified least squares (FMOLS), dynamic ordinary least squares (DOLS) and heterogeneous panel estimators (MG, AMG, CCEMG, DCCEMG) are used. Finally, to verify the causality among the study variables the Dumitrescu and Hurlin, (2012) causality test is used. The findings of the study reveal that income, aggregate, and disaggregate energy consumptions (oil, coal, gas), and trade exacerbate ecological quality in D-8 countries while income and trade improve it in G-7 economies. However, oil, coal, and gas usage are detrimental for ecological quality in G-7 economies. The study validates an inverted U-shaped environmental Kuznets curve in D-8 while U-shaped in G-7 countries. It is recommended that both groups of countries need to adopt green strategies and sustainable patterns for growth and development.