Quinton de Kock and Temba Bavuma shared a 160-run partnership on Friday to help South Africa build an 81-run lead over New Zealand on day two of the second Test.
At stumps, South Africa were 349 for nine in reply to New Zealand’s 268 at the Basin Reserve.
De Kock made 91 and Bavuma 89 before tailenders Vern Philander (36 not out) and Morne Morkel (31 not out) continued the stubborn resistance with an unbroken 47-run stand for the last wicket.
Three overs before lunch the tourists appeared in serious trouble at six for 94, still 174 runs behind New Zealand, who had taken four wickets in the morning session.
But it was another 39 overs before the home side would strike again when Jimmy Neesham took the wicket of a rejuvenated de Kock after tea.
His dismissal ended a sustained counter-attack which saw the South African pair grow in confidence as the New Zealand seamers struggled with their line and length.
De Kock fell with South Africa 14 runs short of the New Zealand total while Bavuma soldiered on until the tourists were 22 runs ahead.
The first session belonged to the New Zealand seamers as Colin de Grandhomme removed Hashim Amla for 21 then Faf du Plessis for 22.
Tim Southee also bowled nightwatchman Kagiso Rabada for nine and Neil Wagner saw off JP Duminy for 16 before de Kock and Bavuma batted South Africa back into the match.
De Kock survived an early anxious moment against his nemesis Jeetan Patel, who has taken his wicket cheaply the four times they have met in the past month.
As his timing and confidence grew, de Kock took a four and six off successive Southee deliveries and handed out th same punishment to Wagner as he raced to his eighth Test 50 in 55 balls.
By the time he had edged a Neesham delivery to wicketkeeper BJ Watling, he had put South Africa in a comfortable position.
Bavuma had a let-off on five when he skied a Wagner bouncer and de Grandhomme slipped when moving to take what should have been a regulation catch.
However there was little risk-taking after that in his 160-ball innings, until he eventually fell when he hooked a Wagner bouncer to Neesham at square leg.
De Grandhomme and Wagner each have three wickets while Southee has two and Neesham one.