UNM (31-15-1, 14-8 Mountain West) lost its fourth straight. The Lobos were swept at UNLV last weekend.
UNM trailed 6-3 entering the ninth when Jered Meek led off with a double. Two batters later, pinch hitter Lane Milligan drew a walk.
Aaron Siple hit into a fielder's choice that erased Meek at third. Sam Haggerty then smoked a two-run double down the left field line to bring the Lobos within a run. Freshman Danny Collier, who finished 3-for-5, grounded out to second base to end the game.
Spencer Thornton was 3-for-4 with a run scored for SDSU (32-14, 13-9). Ryan Muno was 2-for-4 with two runs and three RBI.
Senior Josh Walker (6-4) took the loss in his first Friday start of the season. The right-hander, who usually pitches Sunday, allowed five runs on eight hits and one walk in six innings.
Bubba Derby (6-2) earned the victory despite allowing four runs on 10 hits and one walk in eight-plus innings. Michael Cederoth picked up his 17th save even though he was charged with the final Lobo run in the ninth.
UNM and SDSU will meet again Saturday at 2 p.m. Junior lefty Colton Thomson (5-5, 4.24 ERA) will start for the Lobos against Aztecs southpaw Michael RoBards (4-3, 4.60).