The Springboks were flattered to lead 14-10 after an exciting first half in which Australia bombed two tries. Not much was happening in the second until the 54th minute when Australia substitute prop Taniela Tupou was sin-binned.
Within eight minutes, a stoic Wallabies defense was spiked by tries to South Africa wing Sbu Nkosi and Herschel Jantjies' second, and the Springboks were out of sight of Australia yet again at Ellis Park.
South Africa finished with five tries, all converted by flyhalf Elton Jantjies, to two by Australia.
Springboks coach Rassie Erasmus split his squad to send an advance party to New Zealand for the showdown with the All Blacks next weekend. The 23 in Johannesburg were favored against Australia, but they struggled to get on top of the visitors, who were a match for the Springboks until Tupou's brain fade.
The Wallabies had just stopped a rolling maul from a lineout and referee Paul Williams gave them possession. Just then, Tupou made a dangerous clearout, conceded a penalty, and got himself yellow-carded.
From the resulting scrum, South Africa went right, left, right to finally see Nkosi cross on the wing to make it 21-10. Victory was guaranteed moments later when Herschel Jantjies ran short side from a ruck in which Australia wing Dane Haylett-Petty was occupied, finishing his free run to the line with a dive in front of the TV camera.
Jantjies earned the flourish.
Exactly, two months out from the Rugby World Cup, Jantjies appears to have given the Springboks desperately sought depth at scrumhalf behind No. 1 Faf de Klerk, who was in New Zealand.
"I'm humbled to be here," Jantjies said. "Hopefully this isn't the last time I get to play in a Boks jersey."
He made his Super Rugby debut this year for the Stormers as an injury replacement, and held his own as South Africa's best newcomer. The smallest man on Ellis Park at 5-foot-4 (1.64 meters), he was in the thick of the action.
Francois Louw's turnover of Australia hooker Folau Fainga'a finished 60 meters later with Jantjies scoring from a Nkosi pass for the opening try.
"I never think about scoring tries," Jantjies said. "I'm always in the right place at the right time."
Soon after teammate Andre Esterhuizen was sin-binned for a high tackle, Jantjies put into a gap Pieter-Steph du Toit, caught the flanker's chip ahead, and set the ruck on the try-line from which lock Lood de Jager burrowed over.
Jantjies also got back to his posts in time to help Nkosi scramble out of trouble. It was a half-chance the Wallabies missed. They squandered better chances.
At 7-3 down, Australia had a try disallowed when Samu Kerevi spoiled a clean break from 60 meters out by offloading forward to Lukhan Salakaia-Loto. Then at 14-10 down, Haylett-Petty knocked on the ball while trying to pick it up beside the try-line.
Haylett-Petty scored their only try of the half when fullback Tom Banks gave him an overlap.
The Wallabies had one more shot at the end of the half thanks to a five-meter scrum, but Jantjies ankle-tapped new Wallabies No. 8 Isi Naisarani to end that threat.
Bernard Foley scored Australia's try in the second half from a Kurtley Beale break, and finished with 12 points.
Meanwhile, Jantjies made six tackles, ran seven times, and passed 51. After his second try, he was taken off to acclaim, and named man of the match. His replacement, Cobus Reinach, scored their fifth try in injury time.