Sean Boyd and Jack Moylan maintained their eye for goal to keep Shelbourne on the up.
Boyd opened the scoring from a dubiously awarded penalty right before the interval with Moylan doubling the lead seconds after restart.
It’s six goals for the pair - three apiece - in the last four games as Damien Duff returned to the dugout after his three-match ban to oversee a fourth straight win to lift his team to sixth in the table.
Shelbourne goalkeeper Brendan Clarke made the two key saves of the first half from Liam Kerrigan and Mark Dignam before the drama of what looked a really poor decision gifted them the lead in first half stoppage time.
Boyd dived but failed to meet Farrell’s cross with UCD right-back Michael Gallagher albeit in close attention. To the consternation of the visitors, referee Ben Connolly pointed to the spot.
Boyd sent the penalty straight down the middle to record his sixth goal of the season with incensed UCD manager Andy Myler yellow-carded for dissent.
The second half was just nine seconds old when UCD had only their hesitant defence to blame as Shelbourne doubled their lead.
Moylan kicked off, sending the ball right back to skipper Luke Byrne who launched it forward from just outside his box.
The UCD defence didn’t deal with the long ball as Moylan stole in to lob it over the advancing Moore to bounce through to the net.
UCD worked hard to get back into the game but couldn’t find a way past Clarke.
The veteran keeper produced a brilliant save to deprive Jack Keaney on 80 minutes before saving Kerrigan's penalty in added time.
Clarke; O’Driscoll, Byrne, Griffin; Lunney (Ledwidge, 82), Dervin; Farrell, Hakiki (Wilson, 72), Kane; Moylan (Molloy, 68), Boyd (Carr, 82).
Moore; Gallagher, Yoro, Todd, Osam; Keaney, Keane (Verdon, 72); Kerrigan, Caffrey (Higgins, 85), Dignam (Lonergan, 66); Duffy (Nolan, 85).
Ben Connolly (Dublin).