Russ Smith poured in 17 points and Louisville 56, in the third round of the NCAA Tournament.
Chane Behanan and Kyle Kuric each added 10 points for the fourth-seeded Cardinals (28-9) will face either No. 1 seed Michigan State or ninth-seeded Saint Louis in the West Regional semifinals, Thursday in Phoenix.
Drew Gordon, who limped off the court late in the first half after banging his knee against a teammate, came back and had 21 points and 13 rebounds for the Lobos. Kendall Williams tallied 11 points for New Mexico (28-7), which nearly rallied from a 15-point deficit in the second half.
Gordon's acrobatic tip-in after A.J. Hardeman's missed tip-jam, had the Lobos within 55-53 with just over a minute left.
Peyton Siva, who was limited to six points and as many assists, then had his most important helper of the night for the Cardinals. The junior guard dribbled to the right of the lane, and delivered a pass on the money to the paint to a darting Gorgui Dieng for a two-handed jam with 32.2 seconds left.
Williams then missed a jumper and Demetrius Walker turned the ball over, resulting in a pair of Siva free throws.
Gordon made a long-distance shot with 2.1 seconds left. Elisha Justice missed the front end of a 1-and-1, but Gordon's full-court heave was wide of the backboard.