Number one ranked India took eight Proteas wickets in the morning session as they bowled the hosts out for 130, leaving them needing 208 for victory.
But India were dismissed for 135, with South Africa’s Vernon Philander taking a career-best 6-42.
Victory in Cape Town gives South Africa a 1-0 lead in the three-match series.
A successful chase had looked possible for India when captain Virat Kohli was at the crease but he was trapped lbw by Philander for 28 to leave the score at 71-4.
Ravichandran Ashwin top scored with 37 but Philander took the final three wickets in four balls to complete the victory.
Earlier on day four South Africa had lost eight wickets for 65 runs, with Mohammed Shami and Test debutant Jasprit Bumrah taking three wickets each.
The second Test in Centurion starts on 13 January.
Faf du Plessis’ South Africa will be without paceman Dale Steyn, who did not bowl in the fourth innings in Cape Town and has been ruled out of the remainder of the series with a heel injury picked up on day two.
Duanne Olivier, who has played five Tests, and uncapped 21-year-old Lungi Ngidi have been called up. (Courtesy BBC)