Wrist spinners Yuzvendra Chahal and Kuldeep Yadav bagged four wickets each.
Shikhar Dhawan too stood out with a fluent 76 off 63 balls.
South Africa started the chase on a promising note with captain Aiden Markram (32) and JP Duminy (51) sharing a 78-run stand for the second wicket.
But most of their runs came against the pacers and when Indian spinners got into the act, it was a familiar story as South Africa surrendered to Yuzvendra Chahal (4/46) and Kuldeep Yadav (4/23) to end way behind at 170 all out in 40 overs.
The slide began with the fall of Markram, who was stumped by MS Dhoni after getting beaten by a flighted delivery from Yadav.
It happened to be Dhoni's 400th dismissal in ODIs as he became only the fourth wicket-keeper to reach that milestone in ODIs. (ANI)