Jota scored a hat-trick as Brentford broke Rotherham hearts with two stoppage-time goals in a 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, after fellow substitute Aymen Belaid equalised Jota's first-half opener with a close-range header.
But Jota grabbed his second and third goals to snatch victory on the 50th anniversary of Brentford's fan-led campaign to remain independent of QPR who wanted to mount a takeover bid in 1967.
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.
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 until Forde found the bottom corner with a sizzling drive.
But 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 boss Dean Smith:
"Jota has saved it for us late on. He is a terrific player and I have not worked with a player with such good balance. When he runs with the ball he is a joy to watch and he has a wand of a left foot, but since he came back his work ethic has been wonderful.
"We have an option on extending his contract at the end of the season but there is no hurry on that because the contract option is in the club's favour.
"When he came back I talked to him about whether it was something he wanted (after sorting out his personal issues in Spain) and he wanted to and I'm sure all Brentford fans are glad he did."
Rotherham boss Paul Warne:
"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."