Debutant Lungi Ngidi claimed two late wickets on a costly day for India captain Virat Kohli, as South Africa closed in on a series victory in the second Test at Centurion.
India were set 287 to win after bowling the Proteas out for 258 on day four, Mohammed Shami (4-49) the pick of the bowlers but a stand of 141 from AB de Villiers (80) and Dean Elgar (61) put the Proteas in command.
Captain Faf du Plessis also weighed in with a patient 48 on a surface offering variable bounce, before Ngidi (2-14) and Kasigo Rabada (1-9) reduced the tourists to 35-3 at stumps - 252 runs short of their target.
Ngidi claimed the huge wicket of Kohli, who was earlier fined 25 per cent of his match fee for poor on-field behaviour on day three and looks set to preside over the top-ranked side's first Test series loss for three years.
De Villiers and Elgar had rescued South Africa from 3-2 to 90-2 on Monday and continued to frustrate India in the morning session, the latter not looking comfortable but gaining his reward for digging in when he drove Ishant Sharma to the extra-cover boundary to reach 50.
The brilliant De Villiers deserved a hundred, but the partnership finally ended when the former skipper gloved a rising Shami delivery through to Parthiv Patel and Elgar soon followed, pulling the same bowler to KL Rahul at deep square-leg.
South Africa were 163-5 - leading by 191 - when a pumped-up Shami removed Quinton de Kock (12), but Du Plessis grafted it out after Rahul put down a difficult chance to remove him and Vernon Philander (26) provided support before Ishant (2-40) sent him on his way.
Rabada hung around following Keshav Maharaj's early dismissal but fell before Du Plessis, who struck only four boundaries, was caught and bowled by Jasprit Bumrah (3-70) soon after the paceman gave him another life.
India found themselves deep in the mire after a first wicket for Ravichandran Ashwin (1-78) ended South Africa's second innings, Murali Vijay the first to go, chopping on to a Rabada delivery which kept low.
Ngidi then took centre stage with a hostile spell of fast bowling, although Rahul gifted the 21-year-old his first wicket, tamely steering a short and wide delivery to Maharaj at point.
The Durban-born new boy then claimed the prized scalp of Kohli, the first-innings centurion falling for only five after playing across the line to a delivery which angled in and unsuccessfully reviewed an lbw decision.
Parthiv (five not out) took a nasty blow in the ribs from a hostile short ball from Ngidi, but the wicketkeeper and Cheteshwar Pujara (11no) were still there at the close.
|Storm and Raiders snatch dramatic wins|
|Boateng desperate for ´best in the world´ Neuer to play|
|Great players have to play here - Real Madrid´s Marcelo continues Neymar courtship|
|Salah can win Ballon d´Or with Champions League triumph, says Luiz|
|Roland Garros wins ´exactly the same´ for Nadal regardless of Federer involvement|
|Rebels romp past Sunwolves, Crusaders retain top spot|
|Halep ´stronger mentally´ as she seeks first grand slam title|
|Cipriani on bench for Baa Baas clash|
|Ronaldo´s rival Salah shifts focus back to Liverpool versus Real Madrid|
|Two arrested in Kiev after clashes before Champions League final|
|Johnny Nelson leads tributes after death of Brendan Ingle|
|Batshuayi puts off Chelsea plans until after World Cup|
|Devon Smith back in Windies squad, Hamilton earns maiden call-up|
|Thiago hints at uncertain Bayern Munich future|
|Dhananjaya pulls out of Windies tour following death of father|
|I feel great - Kerr keeps faith with Warriors on the brink|
|Ronaldo: I can´t be compared with Salah|
|Buffon agent backs Paris Saint-Germain move|
|ICC confirms smart watches prohibited|
|Real Madrid v Liverpool: Champions League final in Opta numbers|
|Mane sends 300 Liverpool shirts to Senegal village for Champions League final|
|Arthur will not join Barcelona before December, Gremio insist|
|Real Madrid v Liverpool: Key battles in the Champions League final|
|Trout hits 15th HR, Bundy strikes out 14|
|Rockets star Paul dealing with hamstring injury|
|Does he only care about his hair? - Denmark coach Hareide slams Pogba, France|
|Rockets push Warriors to brink of elimination|
|World number 84 Kicker suspended for match-fixing|
|WATCH: Paul shimmies in Curry´s face|
|Copa Libertadores Review: Estudiantes into last 16 after thrilling win over Nacional|
|Ronaldo: Cristiano and Neymar would be good together at Madrid|
|Rockets honour Santa Fe victims, first responders at game five|
|Real Madrid rejected €150m offers for Asensio – agent|
|Marshall, Baldwin react strongly to Trump´s comments on NFL anthem stance|
|Nabura handed six-week ban for wild kick|
|Pedroia to return for Red Sox on Friday|
|Warriors´ Iguodala ruled out for game five against Rockets|
|Na leads as Spieth makes solid start at Colonial|
|James Harden, LeBron James headline 2017-18 All-NBA first team|
|Manchester United target Fred to decide future after World Cup|
|´Incredible´ Salah is like Messi, says Ronaldo|
|Salah a big candidate for Ballon d´Or - Muller|
|Message from coach keeping Masters champion Reed grounded|
|Anybody can really win it - Seles feels French Open is wide open this year|
|Mambo number 5! - Non-league star channels Lou Bega hit|
|Pakistan to stop wearing smart watches after ICC intervention - Hasan|
|Saha hails ´great man´ Ferguson as legendary Man Utd boss continues recovery|
|Emery´s depth of knowledge impressed Arsenal´s Gazidis|
|Conceicao extends Porto contract|
|Lomax impresses as Saints overrun Tigers|
|McIlroy in contention at Wentworth as Bjerregaard sets the early pace|
|Bad light calls time on Thiem, Wawrinka out in Geneva|
|Garitano in, Canales out at Real Sociedad|
|Caparros accepts new role at Sevilla|
|Pliskova downed by Larsson after drawing Serena in Paris|
|They´re using the anthem as fake patriotism - Warriors coach Kerr critical of NFL|
|Lyon win record fifth Women´s Champions League title|
|French Open 2018: Doing the unthinkable - the men most likely to topple Nadal|
|French Open 2018: How can Rafael Nadal be stopped?|
|Steve Smith named as marquee player for Global T20 Canada|
|Can Emre play? Yes he Can... and so can Milner|
|Liverpool working to help fans after flight cancellations|
|Abbas and Hasan torment sorry England|
|Xavi ´thrilled´ to sign two-year Al Sadd extension|
|Holtby extends Hamburg contract despite relegation|
|Nadal begins French Open defence against Dolgopolov|
|Serena drawn to play Pliskova in French Open first round|
|FA condemns assault of match official|
|Bologna confirm Donadoni departure|
|Yates lead halved in Giro d´Italia|