Mathias Pogba's second-half strike kept Blue Square Bet Premier leaders Wrexham four points clear at the top.
James Dance was lively early on for Luton, soon forcing Joslain Mayebi into making a good save.
Adrian Cieslewicz and Jake Speight had good chances for Wrexham, while Luton's Janos Kovacs should have scored from six yards but sent his header over.
Then, when the Luton defence misjudged Neil Ashton's long punt, Pogba stroked home his side's 73rd-minute winner.
It was the first really good chance of the night and Jamie Tolley was unlucky not to double the visitors' lead late on.
Wrexham's victory was the fifth in a row for caretaker manager Andy Morrell, but Luton drop to fifth after their first defeat in five games.
VIEW FROM THE DRESSING ROOM
Luton Town boss Gary Brabin told BBC Three Counties Radio:
"I told the players at half-time that a mistake would settle this game and that's how it proved to be.
"They came here with a gameplan to get people behind the ball and frustrate us.
"We need to win games ugly. Wrexham have taken that on board and it is working for them."
Wrexham caretaker manager Andy Morrell told BBC Radio Wales:
"It was a really tough game between two teams in good form and we've managed to nick it.
"Our lads are really buzzing. We knew it was going to be hard - I wouldn't say it was 100 miles an hour, it was probably 150!
"The lads dug in, defended really well and we'd said that it might take a long time to score. It might take a mistake or something to open it up and Pogs put it away lovely."
Luton 01 Tyler 06 Pilkington 12 Blackett 15 Howells Booked 18 Osano 34 Kovacs 04 Keane 11 Willmott 19 Dance Booked 13 Fleetwood (T Wright - 66' ) 14 O'Connor (Kissock - 78' ) Substitutes 30 Pilkington 27 Hand 20 Kissock 28 Watkins 39 T Wright Wrexham 25 Mayebi 02 Obeng 03 Ashton 04 Creighton 06 Harris 07 Cieslewicz 12 Keates Booked 18 Tolley 20 Knight-Percival 10 Speight (Morrell - 87' ) 24 Pogba Substitutes 21 Maxwell 16 Hunt 26 Clarke 09 Wright 11 Morrell