Darington Hobson had 15 points and 10 rebounds and Phillip McDonald added 10 points for the Lobos (26-3, 12-2 Mountain West), who matched a conference record for longest winning streak. Utah won 12 straight in 2004-05.
Adam Nigon scored a career-high 23 points for Colorado State (15-12, 6-7) but the Rams couldn't avoid their third straight loss overall and seventh in a row to New Mexico.
Andy Ogide added 12 points and Dorian Green had 11 for the Rams, who lost to a ranked opponent for the 10th consecutive time in a streak dating to 2004.
Trailing by three points, the Lobos went on a 9-0 run to start the second half, taking a 38-32 lead when Gary completed a three-point play 2:49 into period.
But the Lobos struggled to shake the Rams, who used an 11-3 run capped by Ogide's two-handed dunk to go back in front 49-47 with 8:39 remaining.
New Mexico needed a 7-0 run punctuated by Hobson's putback to regain command 60-55 with 3:43 left.
The Rams pulled to 62-60 on Travis Franklin's layup with 2:28 remaining but McDonald made two free throws and Gary finished a fastbreak with a layup.
Colorado State made a final push as Nigon's 3-pointer with 22.4 seconds left got the Rams within 69-66. But the Lobos made three of four free throws in the final seconds and the Rams missed the only shot they were able to get off in the final moments.
Nigon scored 14 points in the first half, including four 3-pointers to help the Rams take a 32-29 lead.
Colorado State led by seven points after Travis Busch hit a running jumper with 1:19 left in the opening half but the Lobos closed with four straight points, including a fastbreak layup by Gary to cut into what had been the Rams' biggest lead.