New Zealand were 95 for five at tea on the fourth day after being set a near-impossible 400 to win.
Nicholls and Watling put on 68 for the fifth wicket after coming together in the fourth over with New Zealand's innings in tatters at seven for four.
They resisted South Africa's potent pace attack for two hours on a tricky pitch before Watling was leg before wicket to Piedt for 32 shortly before tea. Nicholls was 37 not out at the interval.
The magnitude of New Zealand's task was shown in the second over when captain and first innings top-scorer Kane Williamson was struck a painful blow on the left hand by a ball from Vernon Philander which reared up off a good length. He required lengthy treatment before resuming his innings.
Also Read
The team physiotherapist went onto the field twice more to treat the player before Williamson was caught behind off Philander for five.
Latham tried to leave the ball from Steyn that bowled him but it lifted sharply and bounced off his raised bat onto the stumps.
Guptill, a heavy scorer in limited overs international cricket, again raised doubts about his technique in Test cricket when he edged a ball that seamed away from him.
In three innings in the truncated series, Latham and Guptill scored a combined 23 runs and the highest total at the fall of the second wicket was 13, putting pressure on Williamson and the remaining batsmen.
South Africa added 27 runs in 13 overs, for the loss of Philander's wicket, before declaring their second innings on 132 for seven. Temba Bavuma made 40 not out. Tim Southee bowled Philander and finished with three for 46.
Disclaimer: No Business Standard Journalist was involved in creation of this content