India were 28 for three at the close -- with skipper Virat Kohli amongst the victims -- after bowling out the hosts for 286.
It was a remarkable turnaround after South Africa had been reduced to 12 for three by Bhuvneshwar Kumar inside the first half hour.
Counter-attacking batting, led by aggressive half-centuries by AB de Villiers and Faf du Plessis, and some wayward bowling by India enabled South Africa to make a reasonable total on a lively pitch.
Then the South African fast bowlers struck.
Vernon Philander had Murali Vijay caught at gully and four balls later Dale Steyn, playing his first Test match in more than a year, caught Shikhar Dhawan off his own bowling when Dhawan's attempted pull steepled high into the air.
The biggest prize fell to Morne Morkel, who came on as first change and produced a sharply-lifting delivery which Indian captain Virat Kohli edged to wicketkeeper Quinton de Kock after making just five.