Second half tries from Conor Quinn and Cian Aherne and a 10-point kicking contribution from Fergus McFadden helped UCD prevail at Belfield.
McFadden and Ian McKinley chipped in with first half tries for the students, who are now up to 11th in the table.
Buccs led by 14-12 at half-time thanks to converted tries from Sean Carey and Danny Riordan.
And while UCD were able to move 30-19 ahead, tries from Conor O’Loughlin and Kolo Kiripati ultimately handed the visitors two bonus points.