
Matty Blair gave Rovers an early lead with a stunning strike but the Hatters responded well and Elliot Lee equalised on the stroke of half time.
Ben Whiteman struck the winning goal seconds after the re-start and Grant McCann's men showed plenty of grit and determination to hold off a slick Luton outfit.
Rovers began the game in confident fashion and went ahead in the sixth minute when Blair drove into space and beat James Shea with a magnificent curling left foot effort.
James Coppinger then tested Shea with a shot from the edge of the box but the visitors responded well to going behind and kept knocking at the door.
James Collins, who made a nuisance of himself up front, twice wasted good openings and Marko Marosi had to make a smart save to keep out Jorge Grant's free-kick.
An almost inevitable equaliser arrived in first half stoppage time when a corner was headed back across goal by Dan Potts and Lee nodded home from close range.
Rovers made a dream start to the second period when, after just 35 seconds, Whiteman seized upon a loose ball and slammed home from the edge of the area with the aid of a deflection.
Mallik Wilks and Danny Andrew both went close to extending the home side's lead with curling efforts, while Pelly Ruddock-Mpanzu drilled one wide for Luton after robbing Blair in a dangerous area.
James Coppinger should have made the game safe on 70 minutes but fluffed a glorious chance after being teed up by substitute Alfie May.
Glen Rea almost made Rovers pay in stoppage time but he tapped just wide from a corner.
Rovers: Marosi, Mason, Wright, Butler, Andrew, Kane (J Anderson 75), Whiteman, Blair, Coppinger (Taylor 81), Wilks (May 62), Marquis. Subs not used: Lawlor, T Anderson, Prior, Beestin.
Luton: Shea, Stacey, Potts, Bradley, Pearson, Rea, Ruddock-Mpanzu, Grant (Jarvis 85), Lee, Cornick, Collins (O'Kane 76). Subs not used: Justin, McCormack, Shinnie, Isted, Sheehan.
Referee: Tom Nield
Attendance: 7,526 (1,013)