Tom Lockyer and Carlton Morris, with his 20th goal of the season from the penalty spot, were on target in the second half as the Town reversed Cameron Archer's opener for Boro to take all three points from the third versus fourth clash and extend their unbeaten run to 12 matches.
The victory moved the Hatters to within four points of Sheffield United, although the Blades have two games in hand, and four points above Boro.
Manager Rob Edwards made one change to the side that drew 1-1 at Reading last Wednesday, Elijah Adebayo back in the Hatters' starting line-up after missing the win at Rotherham through injury before coming off the bench in Berkshire to provide the assist for Morris' equaliser.
The other change was on the substitutes' bench, where 17-year-old Joe Johnson made his first matchday squad appearance in the EFL having featured among the subs in the FA Cup replay at Grimsby and travelled with the first team in recent weeks.
Third-placed Hatters were looking to extend their 11-match unbeaten run against Boro, who sat a point behind them at kick-off in fourth place, with both sides already guaranteed a play-off spot.
After a cagey start with both sides trying to get a foothold in the game, Adebayo had the first shot on target, taking Alfie Doughty's cross down and creating space to fire straight at Zack Steffen from the edge of the box just after the quarter-of-an-hour mark.
Boro soon found their attacking rhythm, Isaiah Jones' cross on the run rolling into the path of Matt Crooks, but the scorer of the Teessiders' injury-time winner at the Riverside in December couldn't repeat the trick and his side-footed effort went over comfortably over Ethan Horvath's bar.
Town were pressing high and Marvelous Nakamba pinched the ball to combine well with Adebayo on the right, the latter's cross cleared only as far as Cody Drameh, whose shot was blocked.
The right wing-back was soon sending another dangerous volleyed cross in towards Morris, Boro clearing their lines well - and the visitors had the lead five minutes before the break when Archer raced onto Crooks' ball over the top, beat Horvath to a bouncing ball on the edge of the box, then walked it into and empty goal.
The Hatters' best chance of the half came a minute into three added on, when Adebayo nutmegged his way past Jonny Howson, then saw his cross deflected off Darren Lenihan and palmed away by Steffen.
Town were level within four minutes of the restart, Lockyer meeting Doughty's corner with a thumping header that went in off the inside of the far post.
It was Lockyer's third goal of the season on his 98th appearance for the club, and came a night after he was named in the Championship Team of the Season at the EFL awards.
The Hatters were moving the ball around well in an end-to-end game, but after Crooks had shot wide at the near post from a Ryan Giles cross, the hosts had the perfect opportunity to get their noses in front.
Jordan Clark, on as a sub for Allan Campbell, won the ball juist inside the Boro half and fed Morris into space. The Town top scorer looked to have over-run it in the box, but Steffen came sliding out and appeared to catch Morris' trailing leg with his knee.
Morris took on the responsibility from the spot, stroking in his 20th goal of the season and the Hatters' first converted penalty of the campaign.
Marc Bola wasted a good chance to level with just under 20 minutes to go, stabbing his effort wide from Giles' cross, then Edwards made two more changes, Morris leaving the pitch to a standing ovation to be replaced by Joe Taylor, and Luke Berry on in place of Mpanzu.
Lockyer threw himself in the way of a Bola shot from 18 yards with ten minutes to go, and Berry produced one of the tackles of the season in the box to deny another shooting opportunity.
In a landmark moment on 83 minutes, Edwards handed Johnson his senior debut, putting the teenager on in place of Doughty, with Luke Freeman replacing Adebayo, who also walked around the perimeter of the pitch to rapturous applause.
Johnson, who signed his first professional contract after turning 17 in February, made a couple of good interceptions, blocked a couple of crosses and looked assured in all he had to do on his first appearance.
Congratulations Joe from all at the club, we look forward to many more to come!
TOWN: Horvath, Drameh, Lockyer, Bradley (C), Bell, Doughty (Johnson 83'), Nakamba, Mpanzu (Berry 76'), Campbell (Clark 56'), Morris (Taylor 75'), Adebayo (Freeman 83').
Subs: Shea, Lansbury.
Goals: Lockyer 49', Morris (pen) 67'
BORO: Steffen, Jones, Giles, Mowatt, Barlaser, Archer (Muniz 78'), Dijksteel, Howson (C), Crooks, Lenihan, Bola.
Subs: Roberts, Akpom, Hackney, Bilongo, Stott, Sykes.
Goals: Archer 40'
Referee: Graham Scott
Att: 10,063 (1,040 away)