Courtesy Rahane's unbeaten 100, India declared their second innings at 267 for five leaving South Africa with an awkward 30 minutes to negotiate before the lunch.
South Africa were already in trouble tottering at 5/1 at the break.
Opener Dean Elgar (4) was removed by Ravichandran Ashwin, who was introduced in the fourth over. The Proteas still need 476 runs for an improbable win. Temba Bavuma (1 batting) and Hashim Amla 90 batting) were at the crease.
With his sixth hundred in the longest format, Rahane also joined the elite list of Indian cricketers, who have reached three-figure mark in both innings of a Test match.
More From This Section
Late Vijay Hazare (once), Sunil Gavaskar (thrice), Rahul Dravid (twice) and Virat Kohli (once) are the other Indian batsmen to have achieved the coveted milestone.
Rahane batted like a man possessed as he changed gears from cautious to attacking with effortless ease. Kyle Abbott was cut to the boundary while he used the pace of a short delivery from Morne Morkel to guide it over third-man fence for six.
While he played 152 balls for his 52 yesterday, he took another 54 balls in the morning session to complete his remaining 48 runs.
Wriddhiman Saha (23 not out) added 56 runs in only 14.1 overs with Rahane.
Skipper Virat Kohli (88) must be a disappointed man as he missed out on a well-deserved 12th Test hundred, managing to add only five runs to his overnight score of 83.
In all, Kohli faced 165 balls hitting 10 boundaries as Rahane continued without much fuss.
The Rahane-Kohli duo added 154 runs for the fifth wicket, which is by far the highest partnership for any wicket among the either teams in the series.