DeMartino had two touchdowns within the first seven minutes of the game to help the Aggies (4-4, 3-1 Mountain West) build a 17-0 first-quarter lead.
By halftime, the lead swelled to 31-3 as Utah State stymied the Lobos' nationally ranked ground attack.
"I thought the defense shut the run game down," said Aggies coach Matt Wells. "I thought they were dominant."
True freshman Darell Garretson, making his first career start for the Aggies because of injuries, completed his first six passes and finished 14-of-22 for 141 yards and one touchdown.
New Mexico (2-5, 0-3), which entered the game second in the country in rushing with 349 yards per game, finished with a season-low 158.
"I just think we're solid against the run," Wells said. "We're stingy. We know how to play our gap control. We've got good players."
Quarterback Cole Gautsche, who had been averaging 103 yards a game, finished with seven and Kasey Carrier, the conference's top back at 138.7 yards a game, finished with 67 yards.
The Aggies also scored two special teams touchdowns, one coming on a 65-yard punt return from Bruce Natson and the other on a 72-yard run on a fake punt from Jaron Bentrude.
Utah State scored on its first offensive play from scrimmage after defensive end Connor Williams recovered a Clayton Mitchem fumble at the 8-yard line, with DeMartino taking it over.
That set the tone for the rest of the game, Wells said.
"A shot of adrenaline in the arm," he said. "To hand the ball off and it's seven points."
It also helped Garretson settle into the game.
"That was really helpful, especially on the run," Garretson said. "It was a great run by Joey D and it was great blocking by the offensive line, too. Once we got that, I felt like we were rolling; that we were going to roll."
The Aggies next host Hawaii November 2nd at Romney Stadium.