Boro, depleted by Dael Fry’s dismissal for conceding the spot-kick, fought hard but could not find a response.
Diallo sealed the victory, exchanging passes with Patrick Roberts and thumping in the Black Cats’ second nine minutes from time.
Sunderland’s victory lifts them to ninth place in the Championship table, just a point behind Boro who drop down to sixth.
The hosts looked the more potent side in attack and should have gone ahead in the ninth minute when Steffen’s careless clearance flew straight to Diallo, but he scuffed his finish across goal with only the keeper to beat.
The on-loan Manchester United winger went close again with a deflected volley, while Stewart’s attempt was ruled out for offside, following up after Steffen fumbled a Roberts shot.
Roberts set up another opportunity that Stewart speared over the bar and Steffen atoned for his earlier error just before the half-time whistle, clawing away the Sunderland striker’s crisp half-volley after a rare slip by Fry.
Boro barely threatened at the other end, although Black Cats goalkeeper Anthony Patterson needed to be alert to get down and tip a Marcus Forss effort around the post.
Sunderland broke the deadlock, however, when Fry was caught out again just four minutes after the restart, bringing down Stewart as he chased a through ball and earning himself a straight red card from referee James Linington.
Although Steffen guessed correctly, diving to his left to turn Stewart’s spot-kick on to the post, the rebound fell perfectly for the Scotland international to tuck away his seventh goal in six games.
Middlesbrough moved to shore up their back line, sending on former Sunderland man Paddy McNair and his vital challenge prevented Edouard Michut from doubling the home side’s advantage soon afterwards.
Despite half-chances for Riley McGree and Hayden Hackney, the visitors were unable to break down a Sunderland side who utilised their advantage prudently.
Diallo wrapped up the points when he collected a return ball from Roberts and cut inside on to his left foot before firing past Steffen.
Sunderland manager Tony Mowbray told BBC Radio Newcastle:
“I think we deserved to win, we created chances and moved the ball well against a good team who have very definitive patterns of play.
“It’s the right result in my mind, although Middlesbrough will have their own opinions, of course.
“I like this group of players, they’re adapting to this division and working really hard to be a decent team.
“There’s no huge expectation from me or the people in suits at this club to get to the play-offs or get promotion. We just have to keep trying to produce a team that can compete in this division and, as we build it over the next year or two, the aspirations of the team will get higher.”
Middlesbrough head coach Michael Carrick told BBC Radio Tees:
“We’re bitterly disappointed. The manner of it is tough to take, with the decisions that have blatantly gone against us.
“The big decision is the penalty that never was and then the sending off on top of it, which doesn’t make sense to me.
“There’s daylight between them a yard outside the box and Dael [Fry]’s made no attempt to take him out of the game.
“Ross is within his rights to go down, 100 per cent, but to send Dael off on top of giving the penalty when he’s not in the box – it’s a double whammy for us.”