Teenager Tommy Lonergan scored a sublime brace as UCD twice came from behind to lift themselves off the foot of the table in this thriller at the Bowl.

College move a point clear of Finn Harps ahead of their visit to Tallaght Stadium on Sunday to face Shamrock Rovers.

Dundalk's second half collapse meant they blew a chance to join champions Rovers level on points at the top as they slip back to third.

As they did in running up a 2-0 lead at the same venue in May, Dundalk started on the front foot, cutting UCD open a little too easily on five minutes.

Steven Bradley threaded a finely weighted ball through the home defence for the run of David McMillan, one of six ex-UCD players in Dundalk's match day squad.

Cutting in from the angle, McMillan’s low drive was turned round a post by Kian Moore.

UCD briefly played their way into the game and were left fuming on 12 minutes from their first foray forward.

Alex Dunne’s ball over the top found the run of Lonergan who appeared to be hauled down by Same Bone.

But to the home side’s consternation, an assistant flagged for a free out.

In a fast flowing game, College had a left off minutes later.

Darragh Leahy put Ryan O’Kane away down the left to out fox Dunne and whip a fine cross to the back post where Greg Sloggett should have done better than loop a tame header over the top.

Remaining the better side, Dundalk worked Moore again from their sixth corner of the game on 26 minutes.

O’Kane’s delivery found skipper Andy Boyle, sent off here back in May, whose snapshot found the arms of the UCD keeper.

Scarcely a minute later Dundalk had claims for a penalty dismissed as McMillan’s shot struck Michael Gallagher after Keith Ward had got to the end line to cross.

The lively McMillan was then not too far over the top with a brave diving header from Leahy’s arced cross as Dundalk maintained the upper-hand.

And they were finally ahead on 40 minutes.

UCD central defender Gallagher injured himself and was eventually yellow carded when he got his feet following a heavy challenge on Bradley right on the edge of the area.

Further punishment followed, Ward wrapping his right-foot around the free kick to get it up and over the wall, the ball striking one post before bouncing across the goal-line and going in off the other.

Desperate defending then prevented a second Dundalk goal two minutes later, Alex Dunne throwing himself at O’Kane’s shot to deflect the ball out for yet another Dundalk corner.

UCD got right back into the game within six minutes of the restart with a stunning solo goal from Lonergan.

The 18-year-old slalomed through the centre of the Dundalk defence before showing the composure to find the bottom corner with a crisp drive.

With three substitutes on, Dundalk hit back to regain the lead just before the hour.

O’Kane found Ward on the left whose pass picked out Bradley who took a touch before rifling a left foot drive to also find the bottom corner.

Refusing to lie down, UCD responded once again with another terrific goal on 79 minutes.

Longergan’s sublime touch picked out Brennan to find the run of Dylan Duffy who skipped on to drill a shot past Nathan Shepperd.

And College then punished further sloppy Dundalk defending for their winner three minutes from time.

Duffy found space on the right to pick his pass to Lonergan who again showed outstanding composure to take the ball around Shepperd and shoot to the top corner.

UCD: Kian Moore; Alex Dunne, Michael Gallagher (Jack Keaney 43), Sam Todd, Daniel Norris (Mark Dignam 69); Dara Keane, Evan Caffrey; Donal Higgins (Alex Nolan 60), Sean Brennan, Dylan Duffy; Tommy Lonergan.

Dundalk: Nathan Shepperd; Lewis Macari (John Mountney 55), Sam Bone, Andy Boyle, Darragh Leahy (Joe Adama 84); Greg Sloggett, Alfie Lewis (Paul Doyle 55); Steven Bradley, Keith Ward, Ryan O’Kane (Runar Hauge 68); David McMillan (John Martin 55).

Referee: Adriano Reale (Kildare).