An action-packed game at Walsh Park seemed set for extra time before sub Mark Buckley from Inniscarra bundled in a last minute goal to settle it at 3-7 to 3-4.
Galway had reached the break with a 3-3 to 1-5 advantage following a madcap finish to the first half of this topsy-turvy encounter.
Cork led by 0-3 to 0-1 after 15 minutes but a flurry of four goals arrived in as many minutes. Shane Quirke scrambled home Galway’s first amid a crowded goalmouth before Cork midfielder Conor Griffin got a stick to a searching delivery.
Moments later, Cathal Sweeney tore up the other end to smash home and there were more Galway roars when Evan Cox whipped in a third.
Cork clawed their way back and hit the front nine minutes into the second half when Griffin found the bottom corner (2-7 to 3-3).
The temperature started to rise and a member of Cork management was sent to the stand by referee Nicholas O’Toole.
Conor Flaherty levelled from a free before Buckley stabbed the ball over the line in a messy scramble around the square.
Cork clung on and Kevin Moynihan received the Larry Quinn memorial man of the match award.
Earlier, Cork ended Kilkenny’s reign as champions with a two-point success (1-10 to 2-5) in the semi final at St Saviours.
Local interest fizzled out at a blustery Mount Sion when Galway dispatched Waterford by 1-10 to 1-4.
In the curtain raiser, Cork retained the Sonny Walsh Cup defeating Dublin (1-9 to 0-6).
C Griffin 2-0; E Murphy 0-4 (4fs); C Griffin 1-0; P O’Halloran, A O’Donovan, C O’Brien 0-1 each.
S Quirke 1-1, C Sweeney, E Cox 1-0 each; S Gardiner (f), D Kilcommins, C Flaherty (f) 0-1 each.
C Long (Glen Rovers); C Bowles (Newtownshandrum), K O’Donovan (Douglas), J O’Sullivan (Inniscarra); J Kenny (Castlelyons), C O’Brien (Newtownshandrum), C Murphy (Midleton); E Varian (St Finbarrs), K Moynihan (Na Piarsaigh); E Murphy (Glen Rovers), P Cooney (Ballincollig), A O’Donovan (Courcey Rovers); P O’Halloran (Ballygarvan), K Quinn Waites (Kiltha Óg), C Griffin (Newtownshandrum).
P Cullinane (Ballinascarthy), D Linehan (Doneraile), S Barrett (Blarney), L O’Driscoll (Bishopstown), C Murphy (Sarsfields), F O’Leary (Inniscarra), M Buckley (Inniscarra), T Bradley (Aghabullogue), D Milner (Glen Rovers).
P Rabbitte; D Dolan, A Brett, C Larissey; D Reilly, C Flaherty, D Greaney; D O’Shea, C Sweeney; J O’Donoghue, S Quirke, S Neary; S Gardiner, E Cox, D Kilcommins.
O Flannery, C Bryan, L O’Reilly, N Collins, S Jennings, M O’Regan.
N O’Toole (Waterford)