Mayank Agarwal was the batsman dismissed, caught at slip for seven off Keshav Maharaj (1-31) as India built on their first innings lead of 71 runs.
At the break, Rohit Sharma (25 not out) and Cheteshwar Pujara (2 not out) were the unbeaten batsmen.
Earlier, Ravichandran Ashwin finished with 7-145 as South Africa was bowled out for 431 runs (131.2 overs) in its first innings.
The visitors were placed 385-8 overnight and added 46 runs to their score in just over an hour of Saturday's morning session.
Senuran Muthusamy (33 not out) played the heroic hand in stretching the South African innings and frustrating the hosts. Bizarrely, India made regular bowling changes on day four in their bid to quickly take the remaining two wickets.
Ashwin got into the act as Maharaj holed out to long on for nine in the 124th over. But the last wicket stand between Muthusamy and Kagiso Rabada (15) denied India for another eight overs, adding 35 runs.
Rabada was last man out, lbw to Ashwin, who took his tally to 349 wickets in 66 tests. This was his 27th five-wicket haul in test cricket.
South Africa passed 400 in the 125th over, eating into India's total, with time of due importance for the remainder of this test. Ravindra Jadeja finished with 2-124 from 40 overs.
India had declared their first innings at 502-7, including a record opening stand of 317 runs between Mayank Agarwal (215) and Rohit Sharma (176). In reply, South Africa were reduced to 39-3 at stumps on day two.
They fought back through Dean Elgar (160) and Quinton de Kock (111) who scored counter-attacking hundreds on day three. Skipper Faf du Plessis also made 55 runs.