The hosts had looked in complete control as they reached 103 without loss in reply to 334 but captain Graeme Smith then fell and was quickly followed by Hashim Amla and Alviro Petersen as South Africa slumped to 113 for three.
Jacques Kallis, playing his final Test, and AB de Villers then steadied the ship with an unbeaten partnership of 68 to guide their team to 181 for three at lunch.
The Proteas had begun the day on 82 without loss and India would have thought they were up against it when Smith scored a four off the first ball from Ishant Sharma.
Petersen then survived a very tight stumping call in the fourth over of the day but South Africa looked comfortable until Smith fell to a stunning catch from Shikhar Dhawan.
The skipper attempted to launch Ravindra Jadeja over midwicket but Dhawan took a brilliant catch over his shoulder to end Smith's innings at 47.
Just five overs later, Amla suffered a rare failure as Mohammed Shami got one to straighten and removed his off stump to dismiss the prolific number three for just that many.
That was the last ball of the 33rd over and Petersen was gone with the first ball of the next as Jajeda claimed his second victim.
Murali Vijay claimed the catch off an outside edge to remove the opener for 62, reached off 100 balls with eight fours.
South Africa were wobbling at that point but the experienced pair of De Villiers and Kallis saw them through to lunch with the minimum of fuss to leave the contest finely poised.