But thanks to the calm and composed Cooper, the Wallabies found a way win in front of 15,191 fans on the Gold Coast.
Cooper was called into action early when the Wallabies were awarded a penalty 11 metres inside the Springboks half for a rucking infringement.
If he had any nerves Cooper didn't show them, making no mistake with his attempt with the penalty goal.
He was to kick another goal in the 14th minute to level the scores at 6-6 as the teams traded penalties in the early stages of the contest.
The contest took a twist in the 16th minute when Springboks skipper Siya Kolisi was shown a yellow card and sent to the sin bin for 10 minutes for a dangerous tackle on Wallabies fullback Tom Banks.
Having gained territory from the subsequent penalty, the Wallabies went on the attack and were rewarded with a try to winger Andrew Kellaway.
Cooper was involved in the build-up, throwing a dangerous pass to inside centre Samu Kerevi, who broke through the Springboks defensive line before delivering a line-ball pass to Kellaway.
There was still plenty of work to do for the winger, who cut back inside three South African defenders on his way to scoring next to the posts.
However, the Wallabies soon after had disciplinary problems of their own, with lock Matt Phillip sin-binned in the 27th minute for collapsing a ruck close to Australia's tryline.
Just 60 seconds earlier, heroics from Wallabies halfback Tate McDermott denied Springboks centre Lukhanyo Am, who seemed certain to score after being first to a deft grubber kick from halfback Faf de Klerk.
However, the South Africans weren't to be stopped with their numerical advantage, with a powerful push leading to hooker Bongi Mbonambi forcing his way over the line.
Flyhalf Handre Pollard missed the conversion, and with two more Cooper penalty goals before the break, the Wallabies led 19-11 at halftime.
Penalties goals were again exchanged early in the second half and both teams were again reduced to 14 men following sin-binning offences from Springboks fullback Willie le Roux and Wallabies hooker Folau Fainga'a.
Trailing 22-14, South Africa took advantage of Fainga'a's absence, winning a lineout and forcing their way over the line with a powerful push that led to a try from replacement hooker Malcolm Marx.
Pollard's conversion of the try cut Australia's lead to one before another Cooper penalty gave the Wallabies a 25-21 lead with 17 minutes of regular remaining.
However, another Marx try from a maul close to Australia's line in the 73rd minute gave South Africa a 26-25 lead.
Crucially, replacement Damian Willemse missed the conversion. It was one of four kicks South Africa missed on the night, and opened the door for Cooper's post-siren winner.