Goals from Marouane Fellaini – his first in the league this season – and Jesse Lingard either side of half-time put Manchester United in the driving seat until substitute Rudy Gestede pulled one back for Boro to spark a late flurry.
However, Victor Valdes' late slip handed Antonio Valencia the simplest of chances to make it 3-1 and ease Mourinho's men into fifth place in the table, and leave Boro in relegation trouble.
However caretake boss Agnew was encouraged by a battling display and remains convinced his team will get the points they need when they face the teams around them in the relegation fight.
He said: "To push Manchester United all the way was something that I was really pleased with. At 2-0, that's when the players showed their fighting spirit. The crowd played a massive part.
"We deserved the goal and on the balance of play at the time although there wasn't long to go, I could only see us equalising.
"I have every confidence and every belief, all the work that goes in behind the scenes with the staff and the players, that we are more than capable of winning football matches.
"The performance was intense, it was everything you want in terms of commitment. Of course we have got to start winning football matches, but I have been in this league before and I know that one game, one win, three points can change everything."