Liam Doyle scored the Wexford winner two minutes into added time as his side maintained their strong start to Group 4 of the SSE Airtricity League Under-15 Shield in Ramstown on Saturday.
The goal came after a flurry of goalmouth activity that saw Seán Fitzpatrick crash a header off the crossbar, and Seán Adam Gourley have a shot blocked, before it fell for Doyle to force home a critical winning goal to keep Wexford right in the mix for top spot and a semi-final place.
It came at the end of a game in which both sides had their periods of dominance without either doing enough to take overall control.
However, on the balance of quality chances it would be hard to argue that the hosts didn't deserve to nick the points.
U.C.D. looked good in the opening ten minutes.
Returning goalkeeper Luke Murphy had to make a fine save to ensure the hosts maintained parity, but his side slowly grew into the game.
The visitors were intent on patience. They knocked the ball around at the back and kept it well, but struggled to break Wexford down.
On the other hand, Mark Doran's side were happy to allow them the possession, as they dropped off, played with a flat back four, and left Evan Farrell alone up top.
It was all pretty much going to plan apart from the finish. Wexford broke and created several chances, the best of which saw Doyle go clean through on the opposing goalkeeper, but he shot against the foot of the post.
It then came as a real sucker punch when U.C.D. snatched a lead shortly before the interval.
Wexford switched to the tried and trusted three at the back and pushed Tyler Dunphy up top.
It took just five minutes for the rangy Dunphy to turn on the ball in the box and fire low to the bottom corner of the net to tie the game.
Both sides had good spells as the second-half wore on. With Evan Connolly bossing things in the holding role and Dylan Casey strong at the back, Wexford looked solid.
However, they fell behind when a U.C.D. shot from the edge of the area squirmed past the hosts' 'keeper and found the net.
With 20 players finally available to him, Doran rang the changes and was rewarded by one of those alterations.
Seán Adam Gourley wasn't on the field long when he forced home an equaliser two minutes from the end of normal time in a crowded goalmouth.
It was all set up for a dramatic finish, and Doyle provided it with his late winner to move Wexford to four points from a possible six.
These sides will get back together for another battle on Saturday when Wexford travel to Dublin looking to continue their quality start to the shield competition.
It is expected to be a close-fought affair once again.
Wexford: Luke Murphy; Darragh McGuire, Seán Redmond, Dylan Casey, Liam Doyle, Patryk Ramiasz, Seán Fitzpatrick, Evan Farrell, Paddy Redmond, Evan Connolly, Kyle Clancy. Subs. (rolling) - Aaron Phelan, Seán Adam Gourley, Harry Curtis, Tyler Dunphy, Conor Carew, James Cullen, Rian Fitzpatrick, Dylan McEvoy, Kyle Rankin.