The teams are now tied at 1-1 and will meet in Sydney next weekend to decide the three-match series.
Leigh Halfpenny missed an early kick for the Lions during what was a scrappy opening half before landing one between the posts on 10 minutes to give them the initiative.
Christian Lealiifano then scored two penalties for the Wallabies, but Halfpenny was again on target with 28 minutes played to make the score 6-6.
Halfpenny and Lealiifano exchanged kicks once more, only for the Welshman to have the final say of the half as a fourth penalty gave the Lions a 12-9 advantage at the break.
A tense second half remained scoreless until Halfpenny launched a mammoth penalty through the posts on 63 minutes to extend his side's lead.
However, the Aussies snatched the win with four minutes left when Adam Ashley-Cooper touched down before Lealiifano added the decisive extras.
Halfpenny had a final chance to give the Lions a series victory with a penalty in injury time, but the lengthy kick failed to reach the posts.