Wales squandered a 21-point second-half lead at the Principality Stadium in a defeat that will further increase the pressure on head coach Wayne Pivac.
Jac Morgan scored two tries to help put Wales in a commanding position after 52 minutes.
However, Lachlan Lonergan completed a stunning late comeback to snap Australia's three-match losing run and inflict a ninth loss in 12 Tests on Pivac's side.
Morgan added to his double against Georgia by dotting down inside 10 minutes against Australia, either side of two penalties for Ben Donaldson, before Taulupe Faletau powered through a couple of Australian tackles to slide into the corner for a try on his 100th Test.
Gareth Anscombe added to that tally with a couple of penalties as part of a 10-point haul in the first half, though Folau Fainga'a touched down prior to half-time to reduce Wales' lead to two points.
Jake Gordon and Tom Robertson were sin-binned either side of half-time and Australia was made to pay when Morgan found the chalk from a driving maul.
The host went further ahead when Rio Dyer crossed in the corner after a well-worked move.
Nawaqanitawase revived Australia's hopes by twice crossing over and Wales lost its discipline as Justin Tipuric and Ryan Elias were yellow carded, with the referee also awarding a penalty try after the latter deliberately collapsed a driving maul.
Wales still had a two-point lead to protect with a minute remaining but Lonergan walked in a dramatic last-gasp try after yet more good play from Nawaqanitawase, allowing Noah Lolesio to add the game-sealing extras.