It was a solid start to the match from the All Blacks, and the lead belonged to the hosts in the 10th minute when Aaron Cruden broke the deadlock with a penalty.
© Getty Images
However, South Africa were in front just five minutes later when Handre Pollard picked out Cornal Hendricks, who cut inside to find space and score the try, before watching his aforementioned teammate convert the kick.
The visitors did well to survive an extended spell of pressure from New Zealand, but the deficit was reduced before the break thanks to another Cruden penalty.
New Zealand regained the lead just four minutes into the second half when Kieran Read held on to a kick which split the South African back line, before offloading to Richie McCaw to set up his side's second try.
Cruden missed the conversion which followed, and the pressure was back on New Zealand when Pollard's drop goal made it 11-10.
Beauden Barrett added a penalty for the hosts as the match entered the closing stages, and the win was confirmed when a late charge from South Africa ended in failure.