At stumps, the tourists had raced to a 320-run lead in their second innings as they coasted to 284/2, leaving the Proteas with a mountain to climb over the last two days.
Pujara, who was dropped by spinner Imran Tahir on 51, was unbeaten on 135 at the close after racking up his sixth career century.
Kohli, meanwhile, was well on his way to his second ton of the match, reaching 77 not out.
Seam bowler Vernon Philander had got an early breakthrough in India’s second innings when Shikhar Dhawan got an edge to Jacques Kallis in the slips for 15 runs.
With that scalp, Philander became the fastest South African to take 100 Test wickets, achieving the milestone one match faster than Dale Steyn.
The Proteas were handed a blow in the final over before lunch when speedster Morne Morkel was helped off the field after twisting his ankle while fielding on the boundary. He was taken for a scan and it was confirmed he would not bowl again in the match, though he could bat if necessary.
Murali Vijay and Pujara shared 70 runs for the second wicket before Kallis had Vijay caught behind for 39 midway through the second session, but Kohli and Pujara then wrested control of the game with a magnificent stand.
Earlier, India had wasted no time in removing the Proteas tail in the morning session, dismissing the hosts for 244 runs in their first innings.
South Africa resumed at 213/6 and paceman Zaheer Khan struck early when Philander got an outside edge to Ravichandran Ashwin in the slips in the fourth over of the day.
Philander, who put up a valiant fight after a middle-order collapse on day two, made his third career half-century, contributing a well-played 59 runs off 86 deliveries.
Faf du Plessis, who shared a crucial 80-run stand with Philander, tried to prop up the tail after making a patient 20-run contribution, but Zaheer had him caught behind and the Proteas were soon bundled out.
Zaheer and Ishant Sharma took four wickets each to lead a destructive Indian pace attack that took full advantage of the conditions to give their side the upper hand.