India captain Virat Kohli held firm with an unbeaten 85 to prevent South Africa from fully seizing control on day two of the second Test in Centurion.
After dismissing their hosts for 335 in the morning session on Sunday, India reached the close in a spot of bother on 183-5, having managed only one partnership of significant substance.
Yet the tourists' position would have been far weaker if not for their captain, who faced 130 deliveries and will resume on Monday in the company of Hardik Pandya (11 not out).
Batting with greater fluency than anyone else in this match to date, Kohli shared 79 for the third wicket with Murali Vijay (46) after the Proteas had claimed two scalps in as many balls to gain the upper hand.
Vijay's dismissal in the evening session was followed by Rohit Sharma and Parthiv Patel falling cheaply, but Kohli would not be shifted and the match is intriguingly poised as a result.
There was one major scare for India's skipper on 71 when he looked to have been trapped plumb lbw by debutant Lungi Ngidi, only for the thinnest of inside edges to save the batsman when South Africa called for a review.
While a first-innings lead remains achievable for India, they will rue a sloppy showing in the field in Sunday's first session.
Three chances went to ground as South Africa added 66 to their overnight score of 269-6, with Kagiso Rabada put down off successive balls from Ravichandran Ashwin.
The hosts were nevertheless unable to take full advantage, Ishant Sharma picking up the wickets of Rabada (11) and key man Faf du Plessis (63) to finish with 3-46.
Mohammed Shami had earlier ousted Keshav Maharaj, while Ashwin finally claimed his fourth wicket of the innings when Morne Morkel holed out to the off-side sweeper.
It was Morkel who made the first breakthrough in India's reply, taking a return catch to account for KL Rahul, and India were in big trouble at 28-2 when Cheteshwar Pujara was needlessly run out first ball thanks to Ngidi's direct hit from mid-on.
A counter-attacking Kohli and the more patient Vijay looked comfortable as they rebuilt either side of tea, but the latter was unable to kick on to a big score. Vijay fell four short of 50, caught behind looking to cut a Maharaj delivery that bounced more than he expected.
Rohit could only manage 10 before he was trapped in front during a fine spell from Rabada, while the impressive Ngidi had Parthiv (19) caught behind for his maiden Test wicket.
South Africa could not claim the wicket they craved most, though, as Kohli survived his late scare at the hands of Ngidi and crucially batted out the day's remaining overs with Pandya.