Johnny Heaney's 75th-minute goal was the decisive score as Galway squeezed past 14-man Mayo in Castlebar, 1-12 to 0-12.
Kevin Walsh's side will now take on Sligo for a place in the provincial final, while last year's All-Ireland finalists are heading for the Qualifiers once more, following a third successive championship defeat to their neighbours.
In a dramatic finale, Kevin McLoughlin pointed in the third of eight minutes of injury time to tie the scores up for the eighth time, 0-11 each, only for Heaney to pop up tellingly and blast the winning goal to the roof of the net in the fifth added minute.
With 29,449 in attendance at a drab encounter, the visitors led by the odd point from 13 at the break, with Mayo down to 14 men following the first-half dismissal of Diarmuid O'Connor. Conor Loftus (free) and Sean Armstrong shared the first two scores before points from Damien Comer and Barry McHugh (two frees) made it 0-4 to 0-1 in favour of the Tribe at the midway stage in the first half.
O'Connor and Comer (free) traded scores but Mayo were level by the 27th minute thanks to overs from Loftus (2) and McLoughlin. Shane Walsh restored the Galway lead and Mayo's hopes received a massive setback on 31 minutes when O'Connor was dismissed for catching Paul Conroy with his elbow.
Ciaran Duggan and Andy Moran floated over the last two points of a tense opening period that ended with the minimum margin between the sides, as would have been widely expected.
The tireless Keith Higgins and Tom Parsons - his last contribution before leaving the fray with a nasty-looking injury - had the 14 men ahead within seven minutes of the restart but Walsh's excellent effort tied the scores up for the fourth time and his free subsequently had Galway back in front on 56 minutes.
Moran equalised immediately, as did Cillian O'Connor after Duggan pointed superbly from long range. Substitute Sean Kelly and McLoughlin traded points and there was also an exchange between O'Connor and Tom Flynn - but only after Heaney drilled home the only goal of the game.
Galway will take on Sligo on Sunday, June 3rd, while Mayo are in back-door action the following weekend.
Galway - R Lavelle; E Kerin, D Kyne, S A Ceallaigh; G O'Donnell, G Bradshaw, C Sweeney; T Flynn (0-1), C Duggan (0-2); J Heaney (1-0), P Conroy, B McHugh (0-2f); S Walsh (0-3, 1f), D Comer (0-2), S Armstrong (0-1). Subs: P Cooke for P Conroy, E Brannigan for D Kyne, I Burke for S Armstrong, S Kelly (0-1) for T Flynn, J Duane for G Bradshaw, A Varley for B McHugh, T Flynn for P Cooke (BC).
Mayo - D Clarke; E O'Donoghue, C Barrett, P Durcan; S Coen, C Boyle, K Higgins (0-1); S O'Shea, T Parsons (0-1); K McLoughlin (0-2), A O'Shea, D O'Connor (0-1); J Doherty, A Moran (0-2), C Loftus (0-3f). Subs: C O'Connor (0-2, 1f) for T Parsons, D Drake for C Loftus, J Durcan for J Doherty, C Hanley for S O'Shea, D Vaughan for A Moran, B Harrison for E O'Donoghue.
Referee - C Lane.Tweet