A four-run sixth inning proved decisive for the Lobos (13-7-1), who won their fourth in a row.
Kansas (14-6), which is ranked as high as No. 18 in the Collegiate Baseball poll, was held at bay by UNM's pitching, some good defense and timely hitting.
"We're doing it by a little bit of this, a little bit of that, a little bit of everything," Lobos coach Ray Birmingham said. "Nothing outstanding, just executing the game right, putting the ball in play and seeing if they throw it away."
Senior Kevin Baumgartner (1-1) picked up the win in relief in his longest outing of the season. He allowed just one run on one hit and one walk while striking out two in 3.2 innings.
"I felt good, I was throwing my pitches for strikes," Baumgartner said. "My main goal was to throw strikes and let my pitches work for themselves."
Freshman Preston Ryan, who started the game, impressed his coach in his 3.1 innings of work. The right-hander gave up just one run on seven hits and two walks.
"It was good to see Preston Ryan throw decent," Birmingham said. "The way I believe, if your life's a shipwreck, you play baseball like a shipwreck. And so we've had to get him on the straight and narrow. He's just started doing that. That's important. He's a good freshman arm that has to learn to pitch."
The Lobos held a 2-1 lead after the fifth inning when Andre Vigil's sacrifice fly drove in Ryan Padilla. Their biggest outburst would come the following inning.
Chase Harris got it started with a one-out single up the middle. After an Alex Real single put runners at the corners, John Pustay drove in Harris on a groundout to third base.
Ryan Padilla then drew a walk before Jared Holley singled to right field, driving in Real. As Padilla scampered toward third base on the late throw home, Jayhawks catcher Michael Tinsley fielded the ball and threw wildly past third baseman Ryan Pidhaichuk, enabling Padilla to score and make it 5-1.
Following a pitching change, Holley moved to third on a wild pitch and then scored on Vigil's single to right field, capping the outburst.
Padilla, who has been slumping of late, finished the game 2-for-3 with two runs scored and an opposite-field double in the eighth inning.
"The single I had to right (in the fifth) was a changeup and I just stayed through it," Padilla said. "I've been having trouble with those pitches lately. I got it and that's something that built up my confidence into the rest of the game."
Baumgartner got himself in trouble in the seventh when he hit leadoff batter Blair Beck in the foot and then walked Dakota Smith on four pitches. He ended up giving up a run on a sac-fly, but otherwise minimized the damage.
"That's the big thing, if something bad happens, be able to minimize (the damage)," Baumgartner said. "Just focus, don't let that bother me what just happened, just focus on the hitter."
In the eighth, Kansas got a pinch-hit RBI single from Tucker Tharp to pull within three runs, but the Jayhawks would get no closer. Taylor Duree came on in relief of A.J. Carman and got a pop-up and a strikeout to get UNM out of a bases-loaded jam.
Jake Cole then finished the Jayhawks in the ninth on two groundouts and a strikeout, earning his second save as a Lobo.
UNM and Kansas will play again Wednesday at 1 p.m.