Back-to-back losses to the All Blacks in their first two matches of the inaugural competition had made this a must win test for the Wallabies and their coach Robbie Deans.
After a poor first half where they fell behind to Springbok winger Bryan Habana's 42nd test try, scores from forwards Scott Higginbotham and Ben Alexander and a perfect kicking display from Berrick Barnes just about got them across the line.
South Africa, who drew 16-16 with Argentina in their last outing, were still knocking at the door looking for a converted try to tie the match at the end of the match but will rue a lack of a spark in their back line.
"We went into the second half and felt that we hadn't played as much as we would have liked to," Australia captain Will Genia, on crutches after injuring his knee, said in a pitchside interview.
"So we came out with a lot more enthusiasm and energy. We have a lot of pride in what we do. We know we're a good side and just happy to get a good win against a quality opposition."
Springbok captain Jean de Villiers was disappointed that his young team were unable to come away with a victory in Perth, where they again enjoyed good support from the large South Africa community.
"It was probably one we should have won but credit must go to Australia for coming back when they were down at halftime," he said. We have to learn from this and if we're in that situation again, we can capitalise and get a win.
"We probably made one or two errors and that cost us big time. A much better effort than against Argentina but unfortunately not good enough on the day again."
The South Africans had the better of the first half as the Wallabies started nervously and gave away good attacking ball with a series of ineffectual grubber kicks.
The visitors were always going to win a kicking duel and Morne Steyn had already tried and failed with a drop goal attempt before he gave them the lead with a penalty after three minutes.
Berrick Barnes slotted his first attempt at goal after 17 minutes to give the Wallabies some reward for their early pressure but the parity was short-lived.
Australia messed up the restart and the Springboks pounced, driving deep into the home half and moving through the phases before Habana seized the ball at the foot of a ruck and dived over the line under the post.
It was a 42nd test try for the winger and a fifth in four matches against Australia in Perth. Morne Steyn added the extras and South Africa led 10-3 with 20 minutes on the clock.
Francois Steyn extended the lead with a typical long-range penalty kick six minutes later but Barnes almost immediately chipped away at it with one of his own.
South Africa prop Tendai 'Beast' Mtawarira was sin-binned seven minutes before the break for blocking Kurtley Beale when the Australia fullback was chasing a kick but the Wallabies were unable to make the extra man tell and went in 13-6 down.
Australia finally got some tempo in attack early in the second half and were rewarded by a third Barnes penalty in the 47th minute.
Nine minutes later loose forward Higginbotham, fresh off the bench, finally found a way through the Springbok defence and broke a couple of tackles to touch down under the posts and give the home side the lead for the first time in the game.
Barnes kicked the conversion before Francois Steyn tied the match up at 16-16 with another long-range effort but the Australians were finally playing with confidence.
Barnes again edged the home side ahead but Morne Steyn took just four minutes to square up the contest with his second penalty in the 67th minute.
A minute later, though, prop Alexander burst down the touchline to clinch the victory with Barnes adding the two extra points with his sixth successful kick from six attempts.