Allianz Football League Division One
Mayo 1-12 Dublin 0-14
In the last minute of stoppage time, Ryan O'Donoghue's clever free kick crafted an opportunity for Fergal Boland, who duly obliged with a sweet winning point for Mayo.
This game was chiefly about Mayo's resilience because the home team were in considerable bother early on.
Dublin, with Jack McCaffrey thundering forward and Con O'Callaghan a threat, accumulated a 0-6 to 0-2 advantage by the 21st minute.
Mayo, prompted by the splendid Paddy Durcan, remained composed, reeling off four points on the spin courtesy of O'Donoghue (2), Paul Towey, and Bob Tuohy to draw level.
It was a vital burst, the locals began to stir, sensing that possibilities existed.
By the time the interval rolled around the teams were deadlocked at 0-8 each. The issue was delicately poised.
After the restart, though, Dublin made a move. Goalkeeper David O'Hanlon and Paddy Small stroked over frees prior to a Cormac Costello effort from play.
Mayo terminated a 14 minute search for a score when O'Donoghue rifled over a free. Then, in the 52nd minute substitute Stephen Coen reacted smartly to palm a goal following a Jordan Flynn attempt.
Suddenly, Mayo were in front, 1-9 to 0-11. From there on in it was tight and tense.
Costello and O'Donoghue traded frees. Cian Murphy subsequently restored parity and O'Callaghan edged Dublin ahead, clipping a beauty from play.
Mayo kept on grafting with O'Donoghue supplying the equaliser. O'Donoghue's assist for Boland was sharp, and Mayo collected the full complement of spoils.
In Mayo, victories over Galway and Dublin always mean something.
Scorers for Mayo: Ryan O'Donoghue 0-7 (6fs), Stephen Coen 1-0, Jack Carney, Bob Tuohy, Paul Towey, Fergal Boland, Cormac Reape (f) 0-1 each.
Scorers for Dublin: Cormac Costello 0-4 (3fs), Jack McCaffrey and Con O'Callaghan 0-2 each, Brian Fenton, Greg McEneaney, Seán Bugler, and Paddy Small (f) 0-1 each.
Mayo: Colm Reape; Jack Coyne, Rory Brickenden, Sam Callinan; Paddy Durcan, David McBrien, Eoghan McLaughlin; Jordan Flynn, Jack Carney; Conor Reid, Fergal Boland, Bob Tuohy; Aidan O'Shea, Paul Towey, Ryan O'Donoghue.
Subs: Donnacha McHugh for Reid (10), Stephen Coen for Mclaughlin (33), Tommy Conroy for Towey (49), Cillian O'Connor for O'Shea (58), Diarmuid Duffy for Tuohy (64).
Dublin: David O'Hanlon; Theo Clancy, Seán MacMahon, Lee Gannon; Greg McEneaney, Cian Murphy, Jack McCaffrey; Brian Fenton, Seán Bugler; Ross McGarry, Colm Basquel, Ciarán Kilkenny; Paddy Small, Con O'Callaghan, Cormac Costello.
Subs: John Small for McCaffrey (51), Niall Scully for McGarry (54), Peadar Ó Cofaigh-Byrne for Basquel (57), Lorcan O'Dell for Costello (65), Killian O'Gara for P Small (69).
Referee: Fergal Kelly (Longford).