Martin Russell's stylish Students grabbed a crucial win in the west on Saturday evening as Galway United's miserable run of form continued.
Keith Ward's smashing hat-trick, combined with Paul Corry's fine midfield display, left a toothless Galway to reflect on a fourth straight defeat.
Goals from Ward on minutes and Corry on 39 minutes gave UCD a commanding interval advantage and Ward added a third on 51 with a sweet free-kick.
Then Galway enjoyed a pocket of supremacy which culminated in a Stephen O'Donnell goal from the penalty spot in the 62nd minute, but the Students responded instantly when Chris Mulhall set up Ward to complete his hat-trick.
Delighted UCD manager Martin Russell said: "Mathematically we aren't there yet and things can change quickly in football.
"Maybe in other games we played better and didn't take our chances, but we were clinical in this game."
Galway United -- Geraghty, Conneely, McKenzie, Sinnott, Meynell; King (Keane 52), Curran, O'Donnell, O'Brien; Walsh (Molloy 77), K Sheppard (D Sheppard 84).
UCD -- Brennan, Shortall, Leahy, E McMillan, Nangle; Mulhall, Corry, Bolger, Ward (Moore 83); Kilduff, D McMillan (Creevy 67).
Ref -- P Sutton (Clare).