An unbeaten century from skipper Kane Williamson put the Black Caps on top as they reached 321/4 at stumps on day three to lead the Proteas by seven runs.
After morning showers delayed the start of play Tom Latham and Jeet Raval built on their overnight opening partnership moving the score to 83 before Morne Morkel struck.
Morkel removed Latham (50) to claim his 250th Test wicket angling one in at the left-hander's off stump forcing him to play and getting enough movement to beat him but still take the edge with Quinton de Kock claiming a sharp catch.
Raval was a paragon of patience as he was joined by Williamson with the pair adding 190 for the second wicket.
Williamson dominated scoring in the partnership and went to his 17th Test century equaling Martin Crowe's record for the highest hundred tally in New Zealand Test history after becoming the fastest Black Cap to reach 5,000 Test runs.
It took a blinding catch from De Kock to remove Raval (88) as Morkel found the inside edge of the opener’s bat and the keeper pulled off a piece of magic to hold a tough chance.
Two quick strikes from Kagiso Rabada threatened to be the catalyst for another middle-order collapse as Neil Broom (12) was trapped leg before and Henry Nicholls tickled a bouncer through to De Kock off his first ball.
But Williamson (148*) and spin-bowling all-rounder Mitchell Santner (12*) showed great resolve at the tail-end of the day and moved New Zealand into a slender lead.
New Zealand have a chance to take the match by the scruff of the neck on day four but will hope that the weather plays along.