New Zealand scored four tries of their own, but the hosts held firm despite finishing the match with 14 players following a late yellow card.
South Africa have drawn level in their four-Test series against New Zealand after a 33-26 victory in Cape Town.
Captain Siya Kolisi marked his return from injury with a try, while Jesse Kriel and Damain de Allende also crossed as the Springboks bounced back from defeat in the opening Test.
New Zealand scored four tries of their own, but the hosts held firm despite finishing the match with 14 players following a late yellow card.
The third test takes place in Johannesburg next Saturday.

Chelsea Complete Signing Of Emiliano Martinez From Aston Villa
McIlroy Charges Into Tour Championship Contention Despite Rocky Start
Munster Retain Women's Interprovincial Title With Final Win Over Leinster
College Football Returns To Dublin As North Carolina Win Aer Lingus Classic
Newcastle Hand Tottenham Second Straight Premier League Defeat
Final Day Showdown At The K-Club With €450,000 On The Line In Women's Irish Open
Sunday Morning Sports Update
McIlroy Loses Ground After Costly Start At Tour Championship