The visitors went to lunch on 358 for six with a lead of 394 and looked to up the run rate after the interval.
It did not go all India's way in the middle session, as Vernon Philander (3/68) picked up two quick wickets.
Philander first dismissed Ravichandran Ashwin (7) before removing captain MS Dhoni for 29.
Dhoni was out slashing hard and caught at deep point by substitute fielder Dean Elgar on the boundary leaving India on 384/8.
Imran Tahir finally picked up his first wickets of the match to return figures of 2/69, while JP Duminy ended with 2/87.
At lunch, Jacques Kallis with a double-strike had reduced India to 358 for six, a lead of 394.
Duminy later chipped in with two wickets of his own, as he accounted for both Virat Kohli (96) and Ajinkya Rhana (15).
In the absence of Morne Morkel due to injury, Kallis (3/68) stepped up to give South Africa hope on the penultimate day of the match as India's lead steadily increased towards 400.
Philander was at his miserly best, bowling four maidens in a five-over spell which cost just two runs but yielded no wickets.
Kallis removed the top scorer of the match Cheteshwar Pujara (153) just as another session seemed to be getting away from the Proteas.
He later ended the innings of new batsman Rohit Sharma for six as South Africa fought their way back.
Pujara brought up his 150 off 247 balls in the 87th over as the new ball for South Africa did not provide the breakthrough.
After reaching his milestone, Pujara attempted a cut off a Kallis delivery and edged through to AB de Villiers for a well-played 153.
The wicket brought an end to the third wicket 222-run partnership between Pujara and Kohli.
Kallis struck again to remove new batsman Sharma for six as India were left on 325/4. The Proteas all-rounder produced a brute of a delivery, as the ball kept low and jagged back from well-outside off to clatter into the stumps.
Kohli was next to depart for 96 as India fell to 327/5 as he played a cut-shot at a Duminy delivery, but De Villiers gathered the faint edge to send the batsman to the changeroom.
He just missed out on becoming the first Indian number four batsman to score centuries in each innings of a Test match.
With the score on 358, Duminy struck again as he had Rahane caught at first slip by Graeme Smith with the second ball of his over.