Michael Duffy, Mark Connolly and Pat Hoban were all on the scoresheet as Derry City moved to within two points of Shelbourne.