Rugby Championship winner South Africa had been tipped as the leading contender to dethrone New Zealand in Japan and it piled on the pressure in the early stages.
However, it only had three points from Handre Pollard to show for its efforts before sloppiness set in during a six-minute blitz that included tries from George Bridge and Scott Barrett.
Pieter-Steph du Toit crossed and Pollard scored a fine drop-goal as the Springboks regained a foothold in the second half, but the All Blacks were able to retain their record of having never lost a group stage match.
Pollard split the posts in the second minute after Bridge was pinged for not releasing the ball, and the Springboks maintained their commanding start.
He then hit the upright from the tee after Faf de Klerk intelligently won another penalty, but the scrum half's stray pass was pounced on by Richie Mo'unga and Makazole Mapimpi's illegal attempt to win it back led to the five-eighth restoring parity.
The All Blacks had clicked into gear and Mo'unga's cross-field kick enabled Sevu Reece to charge down the right, setting a move in motion that ended with Beauden Barrett darting through a gap and offloading for Bridge to score his eighth try in six Tests.
New Zealand punished another mistake when Pollard dropped a high ball and Anton Lienert-Brown skipped in off the right before sending Scott Barrett under the posts, while Mo'unga missed a chance to make it 20-3 at the break from the left touchline.
Du Toit took advantage of a defensive lapse from the All Blacks to run straight in from a ruck in the 48th minute and Pollard reduced the arrears to four points with a stunning drop-goal from 40 yards out.
Mo'unga slotted through another penalty and the boot of Beauden Barrett helped keep the Springboks at bay as New Zealand extended its winning run in Rugby World Cups to 15 matches.
The Springboks return to action against African neighbour Namibia in Toyota next Saturday, while the All Blacks must wait until 2 October to take on Canada in Oita.