Set a record fourth innings chase in Tests of 539 to win, the home side were 84 for two at tea having lost both openers.
Usman Khawaja was on 16 and Steve Smith was on 11, with South Africa's unbeaten record at the ground set to be extended.
A brilliant piece of fielding by the diminutive Temba Bavuma removed the dangerous David Warner for 35 to end an opening stand of 52.
Warner dropped the ball in front of him and set off for a quick single, with Bavuma pouncing from cover and unleashing a powerful throw while horizontal and still in mid-air.
More From This Section
Four balls later fellow opener Shaun Marsh (15) was caught at second slip by Faf du Plessis from the bowling of Kagiso Rabada.
Things appeared to get worse for the home side when new batsman Khawaja was given out caught behind first ball against the part-time spin of JP Duminy.
Australia would have been 52 for 3 after losing three wickets without the addition of a run, but an umpire decision review saved Khawaja when it showed the ball had glanced his pad rather than the bat.
South Africa declared their second innings at 540 for 8 after lunch when Vernon Philander was bowled by Australian captain Smith for 73.
It ended a brisk 72-run stand with Keshav Maharaj (41 not out) as the visitors batted the home side out of the match after resuming on 390 for 6 on Sunday morning.
South Africa's massive total was underpinned by 141 from Duminy and 127 from Dean Elgar.
The pair put on 250 for the third wicket to strengthen a remarkable comeback after their terrible first day.