In stark contrast to last month’s 57-0 demolition job in Albany, the world champions struggled to gain dominance against the old enemy.
Finding the breakdown packed, the Boks’ defensive line resolute and opposition hooker Malcolm Marx in the form of his life, New Zealand bagged three tries and two penalty goals but rarely turned on the style.
Only McKenzie’s 69th-minute try fitted the bill.
Collecting a David Havili pass on the right, fullback McKenzie scurried free of his marker down the outside edge to score a crucial try.
The five-pointer put the All Blacks up 22-17 and, following a Lima Sopoaga penalty goal, the Boks, reduced to 14-men following a contentious red card to replacement back Damian de Allende, hit back through Marx.
But they couldn’t do so twice.
The win in Cape Town handed the All Blacks their second consecutive Rugby Championship clean sweep, and pleased Hansen.
While he admitted his side had failed to play their natural game, he was chuffed by the late contributions of McKenzie and Havili.
Rieko Ioane also scored a 70-metre intercept try.
“Nice to see a couple of the young guys have the courage to do what they did, I thought Havili and McKenzie combined well there,” Hansen told reporters.
“We’ll go away, grow, learn more about ourselves – that seems to be the song we’re singing this year, but it’s not a bad song.”
In a frenetic and often slapdash Test match, the All Blacks found themselves battling a significantly improved South African outfit.
Dominating the breakdown, the Boks forced 20 turnovers from the typically clinical All Blacks and went blow-for-blow up front.
Hooker Marx defended as an auxiliary loose forward, jackling astutely, while flame-haired prop Steven Kitshoff was everywhere.
The world champions’ sole try of the first half was thus taken in an appropriately messy fashion, with both sides nabbing earlier penalty goals.
First-five Beauden Barrett managed to charge down a 31st-minute Jantjies punt, before kicking ahead for Ryan Crotty to plant down with his waist.
Yet the try came at a cost for the All Blacks as Barrett came off with a head knock, and winger Nehe Milner-Skudder followed suit with a shoulder injury.
Leading 8-3 at the break, the All Blacks went tit-for-tat with the Boks in the second stanza but struggled to nail the decisive play.
Halfback Ross Cronje crashed over in the 45th minute, before Ioane and Jean-Luc du Preez traded tries in the tightest of Tests.
Enter McKenzie with 11 minutes on the clock, and salvation.
“A 57-0 is a bit easier on the ticker,” Hansen said.
“(But) tonight we know we’ve won a Test match, both teams played really well, and when you win those types of games there’s probably a little more to it.
“South Africa will be very proud of their performance.”