Harry Souttar's Blades are six points adrift of the Black Cats after Emmanuel Latte Lath's 80th-minute header earned Boro a first win in three.
Souttar played a full game in defence and fellow Socceroo Riley McGree was subbed off in the 89th minute for the hosts, who moved up to eighth.
"We've lost two games (to Leeds and Middlesbrough), maybe two tougher games than they've lost, and we have to go and get a result we want on Saturday against Stoke," Blades boss Chris Wilder said.
West Bromwich Albion went above Sheffield United and into fourth on goals scored after their 0-0 draw at Blackburn Rovers.
Wayne Rooney's Plymouth Argyle remain without a win on the road in six league games this season after a 1-0 defeat at Millwall.
At Kenilworth Road, Romaine Mundle netted his fourth goal of the season to settle the game after Luton's Elijah Adebayo's strike cancelled out 17-year-old Chris Rigg's opener for the visitors.
View this post on Instagram A post shared by @efl
The victory moved the Black Cats further clear of title rivals Burnley, who were held to a 1-1 draw at 15th-placed Hull City.
But the evening was not without its controversy after the Hatters thought Carlton Morris was onside when he slotted home with the game goalless, only for the flag to go up.
Luton's Carlton Morris and Tom Holmes, as well as Sunderland's Jobe Bellingham and Luke O'Nien, were shown yellow cards as tensions boiled over after the fulltime whistle.
Despite the scenes, when asked if his club should be punished, Sunderland manager Regis Le Bris said: "I don't think so.
"It's an emotional reaction so I don't think we need to be punished for that sort of reaction. Everyone was calm a minute later so there's no problem.
"I'm very proud of the team's spirit and behaviour in the game. Again it's a good win."
With AAP.