The Wallabies were 20-7 down with around 25 minutes left before they fought back to turn the match around.
South Africa landed the first blows as two penalties from Handre Pollard gave them a 6-0 lead with 26 minutes played.
Quade Cooper then missed the chance to get Australia on the scoreboard soon after when he missed with a penalty of his own, but the Wallabies were able to take the lead on 34 minutes as Cooper added the extras to Adam Ashley-Cooper's try.
However, South Africa came back just two minutes before the break when Pollard converted Eben Etzebeth's score.
The visitors began to pull away from Australia five minutes after the restart thanks to the dynamic Jesse Kriel's try, which was kicked between the posts by the reliable Pollard.
Australia gave themselves some hope 10 minutes later through Cooper's first penalty of the match, and they got to within three points of their opponents with five minutes left as Cooper converted after Michael Hooper had gone over.