The Wallabies had to come from 11 points behind to claim their 23-17 win at Suncorp Stadium.
South Africa shot out to a 14-3 lead on the back of tries to Warren Whitely and a long-range effort finished by Johan Goosen.
Wallaby lock Adam Coleman went over in the corner to make it 14-10, before Bernard Foley closed the gap to one just before the break.
A further penalty to Foley gave Australia the lead, which he extended 20 minutes later when he converted his own try.
Morne Steyn replied with a penalty goal for the Springboks, but they were unable to close the gap.
The win was much-needed for the Wallabies, coming off two drubbings from the All Blacks and three losses to England in June.