A wonder goal some seven and a half minutes into added time gave Mayo an unlikely draw in Ballybofey.
Second-half substitute James Durcan somehow managed to get through the middle of the home defence to fire to top corner, albeit with the help of a deflection.
Seconds earlier man of the match Michael Murphy had struck his eighth point to put Donegal three clear. But Durcan stepped up to be the hero for the Westerners.
Mayo never gave up and even though they played second fiddle for most of the contest, they got their reward.
An attendance of 8,759 were given full value for money on a perfect night for football.Donegal had the most possession in the opening half but Mayo were more clinical in front of the posts.
The home side had a two point advantage at the break (0-9 to 1-4) but that doesn't take into account eight Donegal wides and three landed in David Clarke's arms.
The first four points were shared with Jamie Brennan and Michael Murphy (free) pointing for Donegal while Fergal Boland and Brian Reape (free) on target for Mayo.
Donegal then went two ahead through a massive Michael Murphy free from 44m and a good finish from Paul Brennan.
Brian Reape pointed at the other end after a long David Clarke clearance was broken. Clarke almost gave away a cheap goal with a poor kick-out intercepted by Jamie Brennan, but he hurriedly tried to find the unguarded net but his effort went wide.
A goal did arrive on 17 minutes and it stunned the home support. A long, speculative effort from Diarmuid O'Connor found James Carr and he seemed to be going for a point but his effort dipped over Shaun Patton's head for a 1-03 to 0-04 lead for Mayo.
GOAL!!! by James Carr for @MayoGAA pic.twitter.com/44tF2vRlbs
— The GAA (@officialgaa) January 25, 2020
It took Donegal some time to recover and they were off target with some good chances before they finally hit five points without reply from the 22nd to 36th minutes.
Ciaran Thompson (two frees), Caolan McGonagle, Michael Murphy (forward mark) and Jamie Brennan were their scorers.

Before the half-time whistle Fergal Boland added his second of the day for Mayo.
Mayo brought in Aidan O'Shea and Kevin McLoughlin at half-time but Michael Murphy won and pointed a free within 45 seconds of the restart.
Tommy Conroy replied but two placed balls from Michael Murphy had Donegal four up. But Mayo hit back through Diarmuid O'Connor and Kevin McLoughlin (frees) and Bryan Walsh from play to cut the deficit to one (0-12 to 1-8) after 53 minutes.
Michael Langan and Ryan McHugh edged Donegal three ahead. Diarmuid O'Connor landed a Mayo free but Michael Murphy lofted his seventh point from 46m.
Unbelievable goal by James Durcan for @MayoGAA in the last moments of the game to level it!! pic.twitter.com/cwKGRqcEZf
— The GAA (@officialgaa) January 25, 2020
Andrew McClean pointed but two James Durcan frees made it a very nervy finish for the home side.
Ciaran Thompson calmed home nerves with a fine score.
Murphy with his eighth seemed to have wrapped up the points but James Durcan's late, late wonder goal secured a draw for the westerners.
Donegal: Shaun Patton; Caolan Ward, Neil McGee, Eoghan Bán Gallagher; Odhrán McFadden Ferry, Conor O'Donnell, Paul Brennan (0-01); Caolan McGonagle (0-01), Michael Langan (0-01); Eoin McHugh, Ryan McHugh (0-01), Jamie Brennan (0-02); Ciaran Thompson (0-04, 0-03f), Michael Murphy (0-08, 0-07f, 0-01 '45), Peadar Mogan.
Subs: Hugh McFadden for McGonagle 47; Brendan McCole for McFadden Ferry 57; Andrew McClean (0-01) for P Brennan 61; Jeaic Mac Ceallabhui for R McHugh 63; Conor Morrison for N McGee 65
Mayo: David Clarke; Oisin Mullin, Brendan Harrison, Colm Boyle; Padraig O'Hora, Stephen Coen, Patrick Durcan; Tom Parsons, Jordan Flynn; Bryan Walsh (0-01), Diarmuid O'Connor (0-02, 0-02f), Fergal Boland (0-02); Ryan O'Donoghue, Brian Reape (0-02, 0-01f), James Carr (1-00).
Subs: Aidan O'Shea, Kevin McLoughlin (0-02, 0-02f) and Tommy Conroy (0-01) for Parsons, Reape and Carr all ht; Keith Higgins for Walsh 57; James Durcan (1-03, 0-02f) for Boland 65
Referee: David Coldrick (Meath)