Reigning champions Pegasus crashed to their first defeat of this season's ESB Electric Ireland campaign after an enthralling encounter under the Dub floodlights on Saturday night.
It was a game that had virtually everything — some cracking goals, the odd moment of controversy and a stunning comeback from Pegasus.
They looked dead and buried as they trailed 3-1 at half-time, but two goals in a minute restored parity.
UCD edged in front again from a breakaway and Pegasus had a couple of late chances to draw level before the final hooter ended a thrilling contest.
"I was pleased, for the most part, with the way we played and showed such character to get back on level terms," said Pegasus coach Michelle Rainey.
"We are still in contention for a place in the semi-finals and who knows, we could even meet UCD again in the final."
A terrific run by Suzanne Beaney created the chance for Vanessa Surgeoner to open the scoring after only two minutes to give the home team a dream start.
The students levelled 12 minutes later with a somewhat bizarre goal, Nicola Gray drove the ball into the circle and it came off a defender's stick and ended up in the net.
Under IHL rules the ‘own goal' stood and the teams went into the first break level.
UCD went in front in the 23rd minute when Leah Ewart rattled the backboards with a blistering shot from out on the right.
Four minutes later the Dublin side went 3-1 up, Jamie Deacon scoring with a deflected effort at a penalty corner.
Five minutes into the third period Arlene Boyles reduced the deficit from a penalty corner and almost immediately Claire McMahon set off on a mazy dribble and squared for Surgeoner to equalise.
Anna O'Flanagan struck the winner to bring the curtain down on an absorbing 70 minutes.