Sam Prendergast produced a brilliant try-saving tackle on Andrew Kellaway but the Wallabies kept possession and spread it out to the other wing where Max Jorgensen was free to touch down. Lolesio converted brilliantly from the touchline for 10-0.
The score appeared to wake the hosts up and they got back into it as Josh van der Flier crashed over for his 13th Test try in the 23rd minute.
Prendergast’s conversion attempt was a wild one leaving the Wallabies 10-5 up.
The Irish enjoyed their best spell of the match since the opening minutes but a loose pass into touch by James Lowe and then an Aussie turnover by Tom Wright prevented them adding to their tally.
The handling errors were mounting for the Irish, Lowe’s knock on their eighth in the first half hour.
This allowed the Wallabies to clear and cut through the Irish defence, Robbie Henshaw did very well to get to touch the ball down over their tryline ahead of Kellaway.
Prendergast saved the Irish from conceding another try after a pass from captain Caelan Doris was picked off by prop Taniela Tupou.
Tupou showed remarkable pace before an over the shoulder pass was gratefully snaffled by Prendergast, but he was penalised for not releasing the ball.
Lolesio converted the penalty for 13-5. Again Irish sloppiness cost them as a lost lineout - their second of the half - metres from the Wallabies line allowed the visitors to clear their line.
Schmidt went for his half-time talk the happier man with his one-time apprentice Farrell needing some sharp words for his players after an underwhelming display.
The Irish got the first score of the second period, Prendergast landing a long range penalty for 13-8.
This was a vastly-improved Irish team, Doris going over under the posts as the clock ticked towards the half hour to go mark.
Prendergast converted Doris’s eighth Test try to put the hosts ahead, 15-13, for the first time in the match. Lolesio restored the Wallabies lead with a penalty in front of the posts and added another just after the hour mark for 19-15.
The Irish had lost their early vim of the second-half and Farrell threw on the Munster half-back pairing of Jack Crowley and Craig Casey with 14 minutes to go.
A minute later Healy came on to raise the biggest roar of the game as the 37-year-old prop became Ireland’s most capped player, edging ahead of the retired Brian O’Driscoll.
Crowley and Casey injected some much-needed momentum into the Irish attack. Crowley’s delightful grubber kick gained the Irish a line-out close to the Australian line and was rounded off with replacement hooker Gus McCarthy touching down.
Crowley converted to put the hosts 22-19 ahead. The Aussies pressed but a knock on by the previously excellent Wright had Farrell roaring with a mix of relief and joy in the coaches’ box.
The Irish held on just to record their fourth successive victory over the Wallabies - a feat they last achieved back in the 1960s.