Jordan McEneff got City off to a great start after 12 minutes with a close-range header and Michael Duffy rifled home to make it 2-0 early in the second half.
Duffy completed his brace with a delightful lob and Adam Wells pulled one back for the students before Mattie Ward slotted in to seal the points.
Derry leapfrogged Shamrock Rovers after the champions lost 2-1 to Drogheda.
City capitalised on a surprise home defeat for Rovers by brushing UCD aside on Friday night.
McEneff connected with a Duffy cross at the backpost to open the scoring in front of a big Brandywell crowd.
UCD keeper Kian Moore made a series of fine saves in the game but he could not prevent the hosts going two down after 50 minutes.
Will Patching set up Duffy to smash high into the net to double the lead and he added a third 15 minutes later by chipping Moore after going clear.
A close-range finish from Wells on 76 minutes gave the visitors a glimmer of hope but Candystripes substitute Ward ended hopes of a comeback when he turned the ball home from Ryan Graydon’s cross.
Derry City: Brian Maher, Ronan Boyce, Ciaran Coll, Cameron McJannet, Ben Doherty (Shane McEleney HT); Cameron Dummigan (Sadou Diallo 66), Will Patching (Adam O’Reilly 879, Jordan McEneff; Brandon Kavanagh (Ryan Graydon 66), Jamie McGonigle (Sean Patton 74), Michael Duffy (Matthew Ward 74).
UCD: Kian Moore, Michael Gallagher (Harry O’Connor 77), Adam Wells, Jack Keaney, Ciaran Behan, Alex Nolan (Matthew Alonge 77), Jesse Dempsey (Donal Higgins 28), Samuel Clarke (Colin Bolton 36), Daniel Norris, Luke O’Regan (Harvey O’Brien 65), Jake Doyle.
Referee: Eoghan O’Shea (Dublin)
Tags: