The win for the Aggies (2-2) in the teams' 100th meeting breaks a six-game losing streak to UNM (0-4).
Fleming came off the bench for the Aggies to complete 4 of 5 passes, hitting Anderson on a fourth-and-goal situation.
Seth Smith gained 113 yards on 31 carries for the Aggies, offsetting the career-high 98 yards that New Mexico's Dennard Dennis totaled.
The Lobos moved into field-goal position in the final seconds, but James Aho's 47-yarder that would have tied the game was wide right. It was his second miss of the night.