Goals from Marouane Fellaini - his first in the league this season - and Jesse Lingard either side of half-time put 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 - leaving Arsene Wenger's Arsenal in sixth.
The Portuguese said: "(It's a) big win because it keeps us alive in the fourth position race. It was very important to keep us alive.
"Do I prefer (to) finish fourth or win the Europa League? I prefer to win the Europa League because the Europa League gives us the same, gives us Champions League football, but gives us a trophy, gives us prestige, gives us a European Super Cup.
"So I would prefer [that], but maybe we don't win the Europa League, so we have to fight until we can to try to finish fourth and it's what we did today without many players, but with a great answer in terms of attitude and desire from all the boys.
"It is a massive victory for us."
With Zlatan Ibrahimovic suspended, Mourinho handed Marcus Rashford a start and was delighted with his contribution despite his failure to find the back of the net from a series of good opportunities.
He said: "Rashford is in trouble to score a goal. It's really difficult to score a goal for him, but his movement is top class, his dynamic is second to none.
"(He's) so intelligent, so sharp, the first touch to put the ball in the best position to attack the space, to attack the goal. For me, he played phenomenally.
"Goals will arrive, no problem at all."