The winger bounced back after fifteen minutes, converting his first of two penalties to extend the lead.
Morne Steyn's penalty put the reigning champions' first points on the board after 38 minutes, to once again reduce the deficit to five.
Steyn capitalised on the Springboks' territorial dominance and scored twice in quick succession, just short of the hour mark, converting his second penalty of the game before adding a drop-goal to take the lead for the first time.
However, O'Connor's second penalty of the match, 10 minutes from time, proved to be the difference.
The Wallabies held on to their lead to progress to the semi-finals and send the champions home.