The five-eighth dashed home to Sydney late on Friday to be at the birth of his first child - a son, Archie.
Barnes set up the Wallabies' only try of the match just before halftime when he threw a superb dummy before offloading to a rampaging Rob Horne.
He also added 17 points through five penalties from six attempts and a conversion before being replaced by Harris with seven minutes remaining.
Wallabies rookie Cooper Vuna, playing only his second Test, made a costly blunder when he took out Welsh fullback Leigh Halfpenny in the air and was yellow-carded.
Halfpenny kicked that penalty which put his side ahead at the 60th minute 20-19.
Wales started both halves on fire, scoring within the opening three minutes of each.
While he had an excellent game, Barnes made a poor start when he kicked the ball out on the full from outside his team's 22.
Wales then piled the pressure on the home side and, after eight phases hammering the Wallabies defence, winger George North found a hole to plant the ball across the line in the third minute of the match.
Their second try came two minutes into the second half when Australian halfback Will Genia threw a pass to no one which was scooped up by his opposite Mike Phillips who found Jonathan Davies.
The centre toed it ahead twice and beat Rob Simmons to touch down.
The Wallabies threw everything at the visitors as the clock wound down and looked like they would have to settle for a loss, with the series to be decided in Sydney next Saturday.
But then Harris stepped up to nail the kick and break Welsh hearts.