The All Blacks looked to steal a win with a dropped goal to first five-eighths Dan Carter in the last act of the game but the build-up was too pronounced and his attempt was greeted by a South African reception committee and was charged down.
It was a Test of too many errors, tactical and handling, to be called a classic but it had plenty of excitement nonetheless.
South Africa played like a World Cup champion and shut down several attacking initiatives, especially during a torrid second half, from the All Blacks.
While the home team lost it could feel well satisfied at its level of competitiveness for a side rebuilding and it contributed to an outstanding display despite being without its captain Richie McCaw and having lost the two pillars of its forward pack, locks Brad Thorn to suspension and Ali Williams to injury 28 minutes into the game.
Veteran South African locks Victor Matfield and Bakkies Botha, and replacement Andries Bekker, would not have believed inexperienced rivals Anthony Boric and Kevin O'Neill could step up in such fine fashion.
Matfield's departure to the sin bin for a high tackle on replacement No. 8 Sione Lauaki came after a last warning had been issued to both teams. However, that resulted in some inspired play from halfback Enrico Januarie who broke from a ruck past Lauaki and prop Neemia Tialata to run, chip ahead and regather to claim the ball with Francois Steyn's conversion giving South Africa a 30-28 lead.
Lauaki marked his arrival with a superb try after 54 minutes. On the left wing Rudi Wulf, who had several penetrating runs, did a fine job keeping ball in the field and setting in train a series of moves which saw captain and flanker Rodney So'oialo take the ball upfield.
It was cleared to halfback Andrew Ellis. He passed to centre Conrad Smith who linked with Lauaki who rampaged his way over to score and give the All Blacks a 22-17 lead after Carter's conversion.
It seemed to be the lift that New Zealand had needed after its failure to make ground earlier in the game.
New Zealand started the game in attacking mode but the loss of lock Ali Williams after a head clash with South African flanker Schalk Burger which left him dazed and with an aggravation of his ankle injury upset the side's momentum.
However, a strong finish to the half with good running by fullback Mils Muliaina allowed Carter to pull back the margin to only two points.
Forecast rain hadn't arrived by kick-off and the conditions were the best for a home Test this season.
Goddard's whistle dominated the first quarter as he attempted to quickly stamp out anything resembling off the ball play.
South Africa's try followed a break which saw second five-eighths Jean de Villiers in the clear but Pietersen was bundled into touch five metres out. New Zealand failed to control the lineout and a five-metre scrum was called. The blindside move was played at Pietersen was able to go over in the corner.
New Zealand showed much more attacking presence in the third quarter but found it hard to penetrate the consistent Springbok defence - until Lauaki's arrival however.
South Africa 30 (JP Pietersen, Enrico Januarie tries; Francois Steyn con; Percy Montgomery 3 pen; Butch James pen, dropped goal) New Zealand 28 (Sione Lauaki try; Dan Carter con, 5 pen,dropped goal). HT: 17-15