Perez had not won since the opening round of the campaign and after going behind on the stroke of half-time, the cellar-dwellers looked set for yet another disappointing day.
But with a stroke of luck, the San Isidro-based club struck back in the second half with an own goal from UCR defender Jason Scott sending Perez level before Jose Sanchez scored three minutes later to give them a lead they would not relinquish.
While the win was not enough for Perez to rise above bottom spot in the table, Daniel Casas' men did move within a point of second-bottom Puntarenas.
Perez have 10 points from 13 games, while Puntarenas (11 points) sit just behind Belen Siglo XXI (12).
Also on Sunday, Cartagines came from behind to draw 1-1 with Limon, while on Saturday, Puntarenas came from behind to draw 3-3 with Santos de Guapiles.
Deportivo Saprissa (28 points) remain first in the table despite not playing over the weekend, while second-placed Herediano have 27 points.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.