McTominay came on after 87 minutes with United 1-0 down and scored in the 93rd and 97th minutes to secure a 2-1 win and blow the roof off Old Trafford. Ten Hag punched the air and McTominay sank to his knees as United gave fans one of their famous late flourishes and the stadium descended into bedlam.
Ten Hag, no doubt, will delight in watching the final minutes when he comes to analyse the game in his Carrington office next week, but the other 90 might make him wince.
This was like the 1-0 home defeat to Crystal Palace a week ago, except Palace managed to survive United's late pressure and this time Brentford collapsed. Quite why Bryan Mbeumo decided to intentionally handle the ball with the score at 1-1 and give Bruno Fernandes the chance to throw a long free kick into the box for McTominay's last-gasp winner is anyone's guess.
Ten Hag won't be complaining. Judging by this performance, he needs all the help he can get. Just minutes before the miraculous turnaround, the Brentford fans had been singing, "You're getting sacked in the morning."
"It has to be a turning point but also a restart because we have to get into higher levels," Ten Hag said after the match. "The spirit is good, the belief is good and the team is together. We have shown that, we have shown strong character. It can be a turning point but it is up to us.
"We had some opportunities and then the same story again, we conceded a goal on a decisive moment, totally the wrong decision. Two or three players. We started and we were not in formation, an easy giveaway and it sums up our season. Such easy giveaways, you get punished in top football. We have too good players to act like this."
For the sixth time in 11 games this season, United conceded the first goal thanks to defending so bad it was like something from an elaborate comedy sketch.
First, Casemiro needlessly gave the ball away in midfield and then missed his tackle to win it back. Victor Lindelöf, who looked uncomfortable as a makeshift left-back alongside a centre-back pair of Harry Maguire and Jonny Evans, scuffed his clearance in the penalty. When Mathias Jensen's weak shot finally arrived, it squeezed under André Onana's right hand.
It got so bad that midway through the first half, Onana stopped trying to play out from the back and instead started pumping long balls up to Rasmus Højlund. The Denmark striker, strong and aggressive at centre-forward, was the only United player to emerge from the first half with any credit and at half-time Ten Hag decided he'd seen enough of Casemiro and brought on Christian Eriksen in his place.
"These games give fuel to the dressing room," Ten Hag said. "They know how far they have to go to get results. It can't be easy going. In football it is eat or get eaten. Too many times in the first half of this season we got eaten by opponents who are more hungry. This can't be. It has to go away. Every player has to deliver that in every second he is on the pitch. That is the demand, the standard. When you do that, we have seen last season you get a determined team. We were not always determined on every occasion in games, and you get hammered for it. This has to change."
Casemiro looks a shadow of the player who was so influential last season, but he's not alone in his struggle to find some form. For the third game in a row, Marcus Rashford was substituted early.
Just like during the defeat to Palace, the England striker was sacrificed midway through the second half despite United desperately needing a goal. This time, he was replaced after 63 minutes having had just one meaningful effort, when Thomas Strakosha -- making his Premier League debut in goal -- got down low to save at his near post.
Rashford was United's best attacking player last season, scoring 30 goals in all competitions, but it's reaching the point where there's little argument to keep him in the team at the expense of Alejandro Garnacho.
There will be more questions, too, about Onana's place after the Cameroon goalkeeper conceded another goal he should have saved. After contributing to Casemiro's red card against Galatasaray with a horrible pass into midfield, he was at fault for the Brentford goal that got the visitors so close to their first win at Old Trafford since 1937.
It looked at first glance that Jensen's shot had curled into the corner, but the replays showed that Onana had tried to bat the ball away with his right hand and got it horribly wrong. He redeemed himself slightly with two good saves late on, but Turkey international Altay Bayindir -- signed from Fenerbahce over the summer -- would be forgiven for sitting on the bench wondering what has to happen for him to get a chance.
McTominay, who has only started two games this season, has done everything he can to make sure he gets an opportunity when United resume after the international break with a trip to Sheffield United. Ten Hag, meanwhile, has two weeks to ponder whether the dramatic finale against Brentford is a sign of better days to come or brief respite from the lingering storm.