UCD - 1 Shelbourne - 2: They all count, as they say, and no-one was more pleased to see Liam Kearney's 85th minute fluke winner go in than the Shelbourne winger himself - his first goal for the club - and manager Pat Fenlon.
A third narrow win, from a game in which they failed to really sparkle, nonetheless has Shelbourne, who remain unbeaten in the league, up to third in the table.
Kearney's 25-yard volley, off his weaker right foot, took an abnormal bounce a yard or two in front of UCD goalkeeper Darren Quigley and flew up through his hands and into the net for a soft winner.
"Luck has gone against us in some games," said Fenlon of his side's fortuitous winning goal. "If you hit the target you have a chance of scoring, it's very unfortunate on the goalkeeper but we'll take it."
Whatever about the winner, there was quality stamped all over Shelbourne's opening goal on 71 minutes. A classic counter-attack resulted in Ollie's Cahill's sublime cross from the right and Gary O'Neill, again justifying his start ahead of Glen Crowe with another goal, planted a perfectly- placed header past Quigley.
"It was a great move and I'm pleased with it, but I'm not too pleased with how we conceded. I think we had two chances to clear the ball and we didn't," added Fenlon.
That UCD equaliser came within two minutes when Derek Doyle met substitute Stephen Hurley's deep cross to get in a firm header that Dean Delaney got a hand to but couldn't keep out as it dropped in behind him and over the line.
"We just don't have an out-and-out goalscorer and that's the thin line between the top three or four and the rest of us," bemoaned UCD manager Pete Mahon.
"Playing well is just not good enough anymore, we have to just start winning matches, we've had two sickening defeats in the space of two weeks and the manner in which we've conceded goals has been disappointing."
UCD: Quigley; Mahon, McNally, Shortall, Ryan; McWalter, Cawley, McDonnell, Doyle; P Byrne, Sammon. Subs: Hurley for P Byrne (64 mins), Dicker for Cawley (84 mins)
SHELBOURNE: Delaney; Heary, Harris, Dillon, Crawley; Kearney, S Byrne, Reynolds, Cahill; O'Neill, J Byrne. Subs: Crowe for J Byrne (62 mins), Rogers for Reynolds (89 mins).
Referee: T Connolly (Dublin).