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.

1.6Million People Tuned Into Final Round Of Katie Taylor's Retirement Fight
Moment's Silence To Mark Nepal Flood Victims At This Weeks Champions League Matches
Tyson Fury "Looking For New Opponent" Despite Contracted Fight With Anthony Joshua
The Fourth Round Continues At The US Open Today
Monday Morning Sports Update
Full Weekend SFC/IFC/JFC Results & Quarter Final Draws for IFC & JFC
Newbridge Town Beaten By Villa FC In Historic National League Home Opener
Zverev Cruises Through As Fritz Crashes Out Of US Open