India's 73-run win enabled the tourists to take a winning 4-1 lead in the six-match series, their first success in seven bilateral or multi-team series' in South Africa.
India climbed to the top of the ICC ODI rankings for the third time in six months. They overtake South Africa - who will finish the series as the No 2-ranked team.
India had become the No 1 ODI side after taking a 2-0 lead in the series, but had to win four of six matches to retain top spot after the series.
The Proteas had to either tie or win the ODI series to stay atop the rankings.