UNM (25-11-1, 9-4 Mountain West) entered its half of the eighth inning with the game tied 4-4. Jack Zoellener led off with a double and was replaced by pinch runner Kirby McGuire.
McGuire advanced to third on a groundout and then scored on Aaron Siple's sacrifice fly to left field. Fresno State (18-16, 7-9) went down in order in the ninth as Victor Sanchez recorded his sixth save.
Jake Cole (2-1) earned the win in relief despite giving up an unearned run in his one inning of work. Starter Jonathan Cuellar gave up three runs in five innings.
The Lobos trailed 2-0 after the top of the first. Andre Vigil then smashed a three-run double in the bottom of the frame to put UNM ahead.
Chase Harris' RBI single in the fourth made it 4-2. The Bulldogs came back on an RBI groundout in the sixth and then a run-scoring error in the eighth.
The Lobos and Bulldogs will meet again Saturday at 2 p.m.