UC Riverside then got an elegant goal of its own when Richie Osborne ran onto a through ball and delivered a cross to Cesar Diaz Pizarro, who put away the game-winner in the 88th minute.
The loss could be costly for UCI (13-5-1, 5-3-1), which appeared it would add to its Big West lead when it twice earned one-goal advantages.
Coach George Kuntz's defending regular-season conference champions instead saw their lead diminish with just one Big West match remaining.
UCI takes 16 points (three for a win and one for a tie) into its conference finale on Tuesday at Cal Poly San Luis Obispo.
UC Davis (15 points) has two matches left, as do UC Santa Barbara (12 points) and Cal State Northridge (11 points). UC Riverside (14 points) has one match left in the regular season as teams vie for four berths in the Big West Conference Tournament. The conference tournament winner earns an automatic berth into the 48-team NCAA Tournament.
"It's senior night and guys have to care more about protecting the lead," Kuntz said. "We were up twice. You have to be smarter with the ball and things that we've worked on. It's very disappointing how we gave up those [final two] goals.
"We squandered too many scoring chances and we lost too many challenges in the air. That's just unacceptable. [The loss] is just really disappointing. Beyond disappointing."
Freshman Cameron Iwasa opened the scoring, taking a lead pass from Christopher Santana and converting in the 13th minute. Iwasa's booming shot from about 14 yards out went through the clutches of goalkeeper Cody Suppe and into the net.
After Jose Diaz knotted the score in the 39th minute, Christian Hernandez finished a smooth three-man connection to give the hosts a 2-1 lead in the 68th minute.