Replacement flyhalf Pat Lambie landed a 52-metre penalty with a minute to go as South Africa ended New Zealand's 22 game unbeaten run with a 27-25 victory in their final Rugby Championship clash.
Lambie was on for the 20-year-old rookie flyhalf Handre Pollard who had earlier crossed for two tries, and added three conversions and a penalty at Ellis Park as the Boks became the first team to defeat the world champion All Blacks since England in late 2012.
Scrumhalf Francois Hougaard scored the home side's other try as their desire to play a more expansive game with ball in hand paid dividends.
New Zealand's points came via tries from centre Malakai Fekitoa, wing Ben Smith and hooker Dane Coles, with flyhalf Beauden Barrett adding a further 10 with the boot.
Meanwhile, Argentina ended three years of frustration when they fought back from a 14-0 deficit to edge Australia 21-17 in Mendoza and seal their maiden victory in the Rugby Championship.
Both sides scored two tries apiece with the difference coming from the boot of Pumas flyhalf Nicolas Sanchez as Argentina won a controversy-tinged clash in the southern hemisphere tournament at the 18th attempt.