Grant Hall, Paddy McNair and Nathaniel Mendez-Laing were all on target at the Riverside as the Teessiders ensured that they didn't lose any ground on the top-six.
"It was a must-win really," Warnock reflected.
"No good beating about the bush, we'd have been completely out of it today [had we not won]. It's still a hard struggle with other teams getting the results, but what we've got to do is try to not let it fizzle out.
"I thought we enjoyed our game today, we had a lot of threats. We had to change the system almost straight away because they dominated that first 10 minutes and fortunately we didn't concede a goal, but once we changed I thought we were on top.
"I thought we marshalled the game well in the second half and waited for that opportunity. We could have scored a few more in the second half, we had some great breakaways and I thought we looked really dangerous today."
Hall gave Boro the advantage in the 21st minute as he side-footed home from close range after Chuba Akpom had flicked on Mark Bola's corner.
McNair doubled the lead shortly before the break, picking up Yannick Bolasie's pass on the left and curling a low effort through defender Harry Souttar's legs and into the bottom corner.
Mendez-Laing's late third goal wrapped things up, the ex-Cardiff City winger dinking the ball over Angus Gunn following a counter-attack.
Boro stay ninth in the Championship standings, eight points shy of the final play-off berth, with 10 fixtures remaining.