Jota scored a hat-trick and Brentford broke Rotherham hearts with two stoppage-time goals in a breathtaking 4-2 win in the Sky Bet Championship.
Spanish winger Jota's treble and a Nico Yennaris strike ensured three points that looked unlikely with three minutes to go after the Millers had made it 2-2.
Anthony Forde thought he had salvaged only the visitors' second away point of the season with a spectacular 30-yard strike in the 87th minute, after fellow substitute Aymen Belaid equalised Jota's first-half opener with a close-range header.
But Jota grabbed his second and third goals of an otherwise uninspiring game to send the Griffin Park faithful home happy.
Despite the defeat, Rotherham caretaker boss Paul Warne was delighted with his side's performance, saying: "I was very proud of my team because last week we were abysmal.
"I watched Brentford in midweek and they played Sheffield Wednesday off the park so I was fearful, but I've been trying to be positive with them all week.
"In the second half we were the better side and were more of goal threat. I always felt we would score from set-pieces."
But he was disappointed to see it slide late on, adding: "When we got to 2-2 that didn't flatter us at all, so to concede in the 92nd minute was very disappointing.
"I thought it was a penalty but it was unlucky - we must have run over a cat with the team bus.
"I was pleased with how we played and the character we showed because as group they are used to losing, but today they showed they were proud to wear the Rotherham shirt and give it their all."
And he insisted his Millers will not give up the fight for Championship survival.
He said: "Until it's mathematically impossible we will keep fighting. It's a difficult league for us and the first few months were tough so perhaps it's been difficult to shake off the mental scarring.
"But after today I'm not at all embarrassed with way my team played because they played to their max and scored two goals and that is something positive to build on."
Brentford took the lead after 12 minutes when Jota latched onto Florian Jozefzoon's cut-back and lashed a fierce and low drive across goalkeeper Lewis Price into the far corner.
Despite dominating almost totally before the break, Brentford failed to make their possession count and were made to pay for it when Belaid headed home Forde's right-wing cross after 67 minutes.
That was the minute when the Bees fans had been urged to applaud the efforts of fans in saving the club in 1967.
Yennaris edged the Londoners ahead again when he ghosted ahead of his marker to slam Ryan Woods' cross into the roof of the net despite the best attempts of goalkeeper Price with 78 minutes gone.
Brentford thought they had done enough to continue Rotherham's dismal away form, but Forde found the bottom corner with a sizzling drive with just minutes remaining.
Brentford, stung by the frustration of failing to make their dominance count, piled forward and made amends.
Jota made it 3-2 with a penalty after a speculative through-ball was handled by Semi Ajayi, and then made sure of the match ball with almost the last kick of the game.
Romaine Sayers sent Sergi Canos free and his low drive was saved by Price, but dropped kindly for Jota to bundle home.
Brentford should have been out of sight by half-time and Konstantin Kerschbaumer twice came close to scoring.
He was on the end of a well-worked corner routine, with the delivery headed back at the far post by John Egan, but volleyed inches wide.
And the Austrian came even closer two minutes later when he clipped a first-time effort from Jozefzoon's driven low cross against the post.
Brentford were playing the Millers off the park as the visitors dropped deeper and deeper as they tried to make it to half-time without being overwhelmed.
Yennaris smashed a volley into the ground from Jota's precision cross on the half hour when he had time and space to punish the visitors.
Rotherham showed the kind of spirit they will need to escape the drop only in flashes and might have hauled themselves back into the game just before the break.
Winger Jon Taylor whipped a deceptive cross in from the right and Danny Ward got across his marker to chest the ball agonisingly wide of the post.
Centre-back Ajayi might have done better from an acute angle as the half drifted to a close, but his snapshot effort ended closer to the corner flag than the goal.
In the end Brentford's superior footballing technique won the day and ensued the party was not ruined by the Millers.