Opener Rohit Sharma struck 150 off 133 balls in the home team’s 298-7 after a spirited chase of South Africa’s 303-5 in a high-scoring thriller at the Green Park stadium.
Ajinkya Rahane (60) added 149 for the second wicket with Sharma.
India were left needing 11 runs off the final over.
But 20-year-old fast bowler Kagiso Rabada conceded just five runs and claimed two wickets, including the important one of skipper Mahendra Singh Dhoni (31), to lead his team to victory.
Proteas captain AB de Villiers had earlier scored an unbeaten 104 off 73 balls to help the visitors post their imposing total.
The second match will be played in Indore on Wednesday.