St Pat's came from behind to claim a stunning win from an entertaining and action-filled game at Richmond Park.
Shane Keogh's shot put Galway in the lead on nine minutes before Alan Murphy doubled the lead for the visitors with a penalty on 19. Goals from Daryl Kavanagh and Paul Crowley then put Pat's level before the break.
However, Evan McMillan, Derek Doyle and Danny North all netted in the second half to bury Galway, who had Shaun Kelly sent off for two bookable offences.
Galway started with the low-lying setting sun blazing into their eyes from the Inchicore end but it proved no obstacle when they took the lead on nine minutes. Former Saint Brian Cash played the ball into the danger area from the right and Keogh provided the vital touch to fire past Gary Rogers in the Pat's goal.
Kavanagh and Stephen Bradley went close for Pat's after that, but the visitors doubled the lead on 19 minutes when Crowley handled Murphy's shot in the area. Referee Neil Doyle pointed to the spot and Murphy smashed the penalty low and to Rogers' right.
The home side were back in the game on 24 minutes when a long Jake Carroll ball found Kavanagh in space. He darted through the United defence and tucked the ball neatly past goalkeeper Greg Fleming.
Pat's were very close to restoring parity just two minutes later when North's cross found Doyle in the middle, but Fleming blocked Doyle's close-range effort. The equaliser finally came on 39 when Crowley nodded in Bradley's free from the right, following a spell of intense Pat's pressure.
Both sides came out with a positive approach at the start of the second half as they sought a lead goal. It was the home side, however, who secured one. It came on 59 minutes when McMillan connected with Anto Murphy's throw-in and headed past Fleming.
It got even better for the home side on 64 minutes when Doyle got on the scoresheet to make it 4-2 when he slammed the ball home after North was denied. North himself got in on the act on 67 minutes with a cracking low right-footed shot past Fleming.
Any faint hopes of Galway getting anything from the game ended on 78 minutes when Kelly was sent-off after receiving his second yellow card.