The transition to renewable and sustainable energy sources is critical to solving the environmental and socioeconomic problems associated with the use of fossil fuels. This study uses an interdisciplinary approach to analyze the challenges and prospects of a sustainable energy transition in contexts with the recent discovery and exploitation of fossil resources. We study the case of Senegal from 2000 to 2027 and the role of recent discoveries of natural gas in its energy transition. In 2000, Senegal’s energy mix consisted of about 97% fossil energy and only 3% renewable energy. Since then, the country has developed renewable energy sources, including solar, hydro, and wind power, which currently account for about 30% of the total energy mix. At the same time, Senegal’s population and electricity production have grown significantly, leading to a fivefold increase in per capita energy consumption over the past two decades. Projections based on a long short-term memory model that predicts future electricity demand and energy balance suggest a structural shift in the energy mix, with natural gas, oil, and renewables at 47%, 32%, and 21%, respectively, by 2027. Overall, this study presents a comprehensive analysis that highlights the benefits of strategically using natural gas as a transition energy source in contexts with increased electricity demand and continued development of renewable energy sources.