A gemini surfactant imidazoline type, namely N-(3-(2-fatty-4,5-dihydro-1H-imidazol-1-yl) propyl) fatty amide, has been obtained from the fatty acids contained in the mango seed and used as a CO2 corrosion inhibitor for API X-120 pipeline steel. Employed techniques involved potentiodynamic polarization curves, linear polarization resistance, and electrochemical impedance spectroscopy. These tests were supported by detailed scanning electronic microscopy (SEM) and Raman spectroscopy studies. It was found that obtained gemini surfactant greatly decreases the steel corrosion rate by retarding both anodic and cathodic electrochemical reactions, with an efficiency that increases with an increase in its concentration. Gemini surfactant inhibits the corrosion of steel by the adsorption mechanism, and it is adsorbed on to the steel surface according to a Langmuir model in a chemical type of adsorption. SEM and Raman results shown the presence of the inhibitor on the steel surface.