Hornung also had four steals as the Rams (17-9, 6-5 Mountain West) extended their winning streak to 12 straight at Moby Arena.
The Lobos (22-5, 8-3) lost for the first time since Jan. 21, ending a spectacular stretch in which they won seven straight games by an average of 19.3 points.
Gordon scored 13 points and had six boards but really played nothing like he did last weekend, when he had a career-best 27 points and 20 boards in a 65-45 demolition of then-No. 11 UNLV on national TV that vaulted the Lobos back into rankings at No. 18.
He kept turning the ball over in the paint — six times in all — and had a tough time finding shots much less the basket for much of the night.
In the first of three straight games against ranked teams, the Rams hung tough and then built a 60-52 lead thanks to an 8-0 run in which Hornung sank two free throws and a basket.
Gordon's three-point play with 3:22 left made it a five-point game, but when the Lobos had a chance to pull within three, Gordon slipped going to the basket and the ball bounced out of bounds. And Hornung's layup at the other end made it 62-55.
The Lobos trimmed their deficit to 67-63 on Kendall Williams' 3-pointer with 31 seconds left but got no closer. Dorian Green, who led the Rams with 17 points, sank two free throws, and after yet another turnover by the Lobos, Hornung capped his spectacular night with a dunk with 6 seconds left.
Williams led New Mexico with 16 points and Demetrius Walker had 14.
The Lobos came out flat offensively in Fort Collins as Gordon took just three first-half shots, making two and pulling down two rebounds in the first half.
The Rams were without starting forward Will Bell, who was in street clothes because of a swollen left knee, but they controlled the first half nonetheless, leading by as many as seven points before settling for a 30-29 halftime advantage.
The Lobos missed 14 of their first 18 shots, including a dunk attempt that went awry, and the Rams built a 22-15 lead, and A.J. Hardeman even shot an air-ball free throw that wasn't only short, it went wide right.
Colorado State had Moby Arena rocking on guard Jesse Carr's dunk as the first half ticked away, but Jamal Fenton drained a long 3-pointer at the buzzer to pull the Lobos to 30-29 at the break.