In a closely-fought contest, it was South Africa who had the upper hand in the first half.
Steyne added further points from the boots as South Africa took a 13-6 lead into the half-time break.
Australian replacement Scott Higginbotham scored the first try of the second half, powering through two defenders to dive over.
Barnes and Steyne once again exchanged points from the boot to level the scores at 19-apiece.
With nothing to call between the sides, a try in the left-hand corner from Ben Alexander proved the crucial score, putting Australia 26-19 up.
Australia showed good composure in the final 10 minutes as they held out for their first win of the tournament.