Harlequins director of rugby Conor O'Shea admitted his side "got away with" a below-par performance before emerging with a 31-28 win at London Irish.
Tom Casson's last-gasp score looked for the all the world like a knock-on but television match official Graham Hughes ruled that the ball had ricocheted forward off the centre's knee, making the subsequent grounding legal.
"We know that at the end of the season you look back and you have games like this," he said. "It's a massive four points for us to come away with because Irish played well and it's a tough place to come."
Guy Armitage's first-ever Premiership try and 23 points from the left boot of Ian Humphreys appeared to have set the Exiles on their way to victory, before Casson's late effort broke their hearts.
Danny Care and Tom Williams also crossed for the defending champions who ended a run of two successive defeats in the Premiership while the Exiles stay in 11th with only a losing bonus point to show for a titanic effort.
O'Shea added: "I think we really picked up the intensity in the final five or six minutes after we went behind and that was crucial. The whole team picked up in intensity and we saw more people carrying, more people getting into the game and looking for the ball.
"Everyone forgets certain games at the end of the season - it's all about playing your best all season and fortunately this was one we got away with without playing at our best."
London Irish director of rugby Brian Smith saw the controversial final play a little differently.
"The guy who had the responsibility made his call and while I don't agree with it there might be some who do," he said. "The key thing for us is to take the spotlight off the incident at the end and focus elsewhere - we're a good team.
"We played well against the champions of England and I think we deserved the win, but at the same time if you ask yourself, 'Could that game have gone either way?', you have to say, 'Yes, it probably could have'."