As sustainability emerges as a crucial factor in the development of modern enterprises, integrating environmental, social, and governance (ESG) information into financial assessments has become essential. ESG indicators serve as important metrics in evaluating a company’s sustainable practices and governance effectiveness, influencing investor trust and future growth potential, ultimately affecting stock prices. This study proposes an innovative approach that combines ESG sentiment index extracted from news with technical indicators to predict the S&P 500 index. By utilizing a deep learning model and exploring optimal window sizes, the study explores the best model through mean absolute percentage error (MAPE) as an evaluation metric. Additionally, an ablation test clarifies the influence of ESG and its causality with the S&P 500 index. The experimental results demonstrate improved predictive accuracy when considering ESG sentiment compared to relying solely on technical indicators or historical data. This comprehensive methodology enhances the advantage of stock price prediction by integrating technical indicators, which consider short-term fluctuations, with ESG information, providing long-term effects. Furthermore, it offers valuable insights for investors and financial market experts, validating the necessity to consider ESG for financial assets and introducing a new perspective to develop investment strategies and decision-making processes.