Gleeson had some uncertain moments all afternoon too but when faced with a kick to win it into the sixth minute of injury-time he held his nerve impressively to guide between the posts and sink a Mayo team that had looked poised to reclaim the title at the end of normal time when Tommy Conroy had put them two points clear, 0-15 to 0-13.
But Galway kept pressing and hunting and were rewarded with two Rob Finnerty frees from close range for fouls on substitutes John Maher and Daniel O’Flaherty before Gleeson’s coup de grace. Cillian O’Connor had a chance to level after that that was well wide.
Mayo may raise issues about referee David Gough’s awarding of Gleeson’s free as Conor Loftus was surrounded in an aggressive press by Paul Conroy and Matthew Tierney after taking a kick-out from Colm Reape. But Gough was adamant and Gleeson stepped up to convert his second and most important free in a game that was mired in mistakes.
But that won’t concern Galway for whom Damien Comer was the leading light with Mayo unable to suppress his power and movement.
David McBrien was tasked with tracking Comer but in this form he is irrepressible and with Rob Finnerty in flying form too, contributing eight points from play and frees, Galway had a slight attacking edge.
For Joyce, the 2022 quarter-final in Castlebar was his only win in nine attempts through Connacht league, league and championship up to now so this restores the balance somewhat and for good measure it’s a first Connacht final win over their neighbours in three attempts under his stewardship.
It also completes the county’s first three-in-a-row in Connacht for 40 years and sets them up in a group that will have the Ulster final losers, Derry and Westmeath.
Joyce made two -pre-game changes from the team announced earlier in the week, replacing Maher and Shane Walsh with Kieran Molloy and Cathal Sweeney. But by the 33rd minute those changes had been reversed, a clear admission that they hadn’t worked. Maher and Walsh both made strong second half impacts.
Galway also struggled to get their captain Seán Kelly into the game from centre-forward and Mayo had a decisive first-half edge.
Comer was the obvious threat to that Mayo comfort though, underlining that as early as the sixth minute when he took on his marker David McBrien, cut in along the end line and hit the sidenetting under sufficient pressure to win a free.
It was one of three frees that Comer won for Rob Finnerty to convert in the first half while he also added a point from play and drew a great save from Colm Reape in the 14th minute after he had turned McBrien running on to a nice ball popped into his path by Finnerty.
But Mayo were largely in control through the half, even as a strengthening wind blew against them.
There was just more energy to them in that period and on the line their management sensed that too, urging them repeatedly to run at the Galway defence.
When they did, gaps appeared, with Jack Carney running hard from midfield to create a couple of chances.
A 0-7 to 0-5 lead looked just about where Mayo needed to be but within minutes of the restart Galway had hit the front, 0-8 to 0-7.
That might have been more but for some good scrambled defence from Rory Brickenden and Colm Reape to deny Maher a goal after Comer had put him in on 39 minutes with an incisive move.
Mayo hit the front again through Jordan Flynn, Matthew Ruane after Gleeson was caught outfield in possession and O’Donoghue from 45 metres on the loop.
But Galway weren’t going away and were level again, 0-11 each on 61 minutes, before leading 0-13 to 0-12 through a Walsh point three minutes later.
Mayo steadied and Conroy was centrally involved in the next three points, winning a free for O’Donoghue before landing the next two himself.
It looked like they could manage it from there but Galway found a way with that impressive late surge.
Scorers – Galway: R Finnerty 0-8 (5fs), S Walsh 0-3 (1f), C Gleeson (2fs), D Comer 0-2 each, J Heaney 0-1. Mayo: R O’Donoghue 0-6 (4fs, 1m), M Ruane 0-3, T Conroy 0-2, J Flynn, F Boland, C O’Connor, D McHugh all 0-1 each
Galway: C Gleeson; J McGrath, S Fitzgerald, J Glynn; D McHugh, J Daly, L Silke; P Conroy, C Darcy; J Heaney, S Kelly, K Molloy; R Finnerty, D Comer, C Sweeney. Subs: J Maher for Molloy (21), S Walsh for Sweeney (33), M Tierney for Heaney (52), S Mulkerrin for Fitzgerald (65), D O’Flaherty for Daly (71).
Mayo: C Reape; J Coyne, D McBrien, R Brickenden; E McLaughlin, D McHugh, S Callinan; J Carney, M Ruane; S Coen, F Bolan, J Flynn; T Conroy, A O’Shea, R O’Donoghue. Subs: D O’Connor for Boland (45), C O’Connor for O’Shea (54), E Hession for Flynn (58), C Loftus for Coyne (65), B Tuohy for Carney (72).
Referee: D Gough (Meath).