After 97 minutes of turgid and tepid football, McTominay provided the one real moment of quality when Marcus Rashford - on the occasion of his 250th United game - teed him up for the Scot to drill home a well-taken strike beyond Lukasz Fabianski from twelve yards. It was a goal reminiscent of the great Paul Scholes, both the manner of the finish and the way in which McTominay ghosted into the box just at the right moment.
On a bitterly cold night at Old Trafford, the match pitted twelve-time winners United up against former boss David Moyes with Ole Gunnar Solskjaer's team looking to set up a seventh successive quarter-final.
Solskjaer shuffled his pack and made six changes from the dramatic draw with Everton at the weekend as he handed rare starts to Nemanja Matic, Alex Telles, Donny van de Beek and cup keeper Dean Henderson.
United had all the possession against a team sitting deep, and it was clear from early on that Moyes had sent West Ham out to frustrate the Reds and defend in numbers. The recalled Anthony Martial saw the first chance of the cup tie fall his way as his close range snapshot was well-blocked by Angelo Ogbonna on the stretch. The Hammers centre-back was injured in the act of blocking the ball and the visitors were forced into an early change as Issa Diop came on to replace the Italian.
Mason Greenwood was also denied by another last-ditch intervention, this time from Tomas Soucek, before the tie somehow stayed scoreless on 27 minutes as United kept up the pressure. West Ham needed Fabianski to be at his best as he changed direction to inexplicably palm a Victor Lindelof header onto the post after Telles had picked out the defender from a corner.
Van de Beek had a shot deflected over, from another teasing Telles delivery, and there was then a nasty clash of heads between Martial and Diop, as the latter became the first ever player to be the victim of the new concussion substitute rule, with the substitute himself replaced by Ryan Fredericks at the interval.
It was looking like one of those nights where the opposition keeper simply saved everything, and the Polish stopper was called into action again on 53 minutes, this time to deny Rashford from point blank range.
The Hammers had been content to sit back and contain United, but the visitors finally came out their shell as the half wore on, and Pablo Fornals went close on the counter-attack, but fortunately he was unable to turn the ball home after Ben Johnson - another sub - had picked him out.
Having failed to kill off the tie when on top, the Reds were suddenly on the back foot and had further defending to do when Aaron Wan - Bissaka's risible, skied clearance needed the attentions of the otherwise redundant Henderson, whom tipped the ball over the ball for a corner.
That prompted a double change from Solskjaer with McTominay and that man Fernandes introduced in place of Matic and the almost anonymous van de Beek.
Fernandes was inevitably straight into the action as the game entered the final ten minutes, as the Portuguese playmaker tried his luck from distance only to see the effort deflect away to safety. Martial went close with a header and Rashford flashed a shot wide as United upped the ante in search of a late winner.
With extra-time looming, there was - predictably - a heart in mouths moment for United as a late Hammers corner caused panic and Craig Dawson's flicked header was blocked under the bar by the stretching Wan - Bissaka.
AWB was forced off for the additional 30 through injury, having sustained a knock, with Brandon Williams going to right-back and Shaw replacing Telles on the opposite flank.
You always felt the tie would ultimately be settled by either a mistake or a piece of brilliance, and so it proved through the latter. The Reds broke on West Ham at trademark speed, as Fred caused panic in the visiting ranks with an uncharacteristic foray forward. The Brazilian whipped the ball in, Edinson Cavani's flick on found Rashford and he knocked the ball into the path of the onrushing McTominay who fired the ball home on the run - ala Paul Scholes.
Yet another sub, West Ham's Said Benrahma, almost equalised when his header was well saved by Henderson, but he was offside and so the goal wouldn't have counted anyway.
Martial almost added a second at the death, but United had done enough to book our place in the last eight for a seventh successive season and remain on course for potential cup glory.
Overall team performance: 7/10
United Faithful Man of the Match: Alex Telles. Rarely tested defensively but looked excellent going forward and his crossing proved a threat throughout