Career best figures from seamer Matt Henry and a solid start from Tom Latham and Jeet Raval left the Black Caps in a good position after day two of the third Test against the Proteas.
Henry took 4 for 94 as New Zealand bowled South Africa out for 314 with Quinton de Kock yet again bailing out a misfiring top order with a brilliant 90.
Faf du Plessis (53) held things together early on building successive fifty partnerships with Temba Bavuma (29) and De Kock before Latham held on to a screamer to remove the South Africa skipper off the bowling of Mitchell Santner.
Quinton de Kock was at his dangerous best on day two. The classy left-hander frustrated the Kiwi bowlers as he breezed his way to his ninth Test half-century.
He whacked 11 fours and two sixes on his way to 90 before he fell to Neil Wagner with a third Test ton in sight.
Wagner was not at the peak of his powers but still picked up key wickets accounting for Keshav Maharaj before doing in De Kock.
Latham (42*) and Raval (25*) did an excellent job of grinding to the close without losing a wicket as they faced 29 overs reaching 67/0 to trail by 247.
The Black Caps will be pleased with the situation they find themselves on but will need to be wary of a dangerous Proteas bowling attack and they will have the collapse in Wellington in the back of their minds.