At the end of the third day in Ranchi, the tourists were on 132-8, trailing India by 203 runs, with replacement batsman Theunis de Bruyn on 30 and Anrich Nortje, on five.
De Bruyn came in under the new concussion sub rule after Dean Elgar took a nasty hit on the helmet from a short delivery by Yadav and had to retire hurt on 16.
The impact left the opener shaken as he lay on the ground getting physio assistance, and officials called for early tea with the Proteas reeling on 26-4.
Events did not improve for South Africa as Shami claimed three wickets, including South Africa skipper Faf du Plessis for four, while Yadav struck twice.
South Africa’s first innings ended on 162 earlier as they chased India’s 497-9 declared.
The hosts made them bat again, and Yadav drew first blood, getting left-hander Quinton de Kock -- who was promoted to open the innings -- bowled for five.
Shami took over to get first innings half-centurion Zubayr Hamza for nought with a delivery that rattled his off stump.
The pace spearhead then got du Plessis’ prized scalp and Temba Bavuma caught behind for nought. Spinners Ravindra Jadeja and Ravichandran Ashwin also took a wicket each to force an extension of the final session but de Bruyn and Nortje survived the final few overs.
India’s wicketkeeper Wriddhiman Saha suffered a finger injury in the final session and Rishabh Pant took over.
According to new rules, a team is also allowed to replace a wicket keeper.
The South African batting fell flat after starting the day on nine for two in their first innings with Yadav and Shami sharing five wickets between them. Hamza, playing just his second Test, scored a battling 62 to offer some resistance during his 91-run fourth-wicket stand with Temba Bavuma, who made 32.
Opening batsman Rohit Sharma put India in command of the final Test with his maiden double century in the five-day format on Sunday. He made 212. India won the first two Tests by big margins in Visakhapatnam and Pune.AFP