A Ross Taylor century helped New Zealand to a six-run victory to end South Africa's long winning run and square their one-day international series.
Taylor's unbeaten 102 saw the Black Caps to 289-4 after they were put in to bat at Hagley Oval in Christchurch on Wednesday.
Jimmy Neesham (unbeaten 71) and Kane Williamson (69) were also key contributors for the hosts in the second ODI.
Only Quinton De Kock (57) and Dwaine Pretorius (50) could make half-centuries for South Africa, who fell short at 283-9 in their chase to see their ODI winning streak ended at 12.
The result leaves the five-match ODI series level at 1-1 ahead of the third match in Wellington on Saturday.
New Zealand made another slow start as Tom Latham's poor form continued, the opener clipping Wayne Parnell (1-49) to square leg.
Dean Brownlie (34) was unlucky to be given out lbw to Pretorius (2-40), and that brought Taylor to the crease.
Taylor and Williamson put on 104 for the third wicket before the latter fell at the hands of Imran Tahir (1-61).
Taylor was fortunate - dropped before surviving a review - as he and Neesham dominated.
The duo made 123 off just 104 balls, Taylor bringing up his century with a four through cover off the final delivery of the innings.
His 17th ODI ton saw Taylor go past Nathan Astle for most ODI centuries for New Zealand.
The Black Caps made the perfect start with the ball as Tim Southee (1-60) trapped the dangerous Hashim Amla (10) in front.
Colin de Grandhomme (1-10) then removed Faf Du Plessis (11) to leave South Africa at 51-2.
JP Duminy (34), AB De Villiers (45) and David Miller (28) all made starts without going on with it, and it would prove to be costly.
The tourists needed 86 off the final 10 overs, and that seemed possible until Trent Boult (3-63) bowled Pretorius with a full toss.
Southee bowled four dot balls to start the last over as New Zealand closed out a tight win.