After half-an-hour Saints had found themselves 15 points down, but fought back superbly after the break to lead by six with three minutes to play thanks to tries from Luther Burrell and Tom May and 20 points from Ryan Lamb.
However when the emotion from the loss dies down one simple fact remains - wins are rare when you gift an opposition as accomplished as Harlequins three tries from your own mistakes.
Having started the game so well, looking dangerous and getting the first three points from a Lamb penalty, the Saints shot themselves in the foot. A dropped pass in midfield from Paul Doran Jones was compounded not just by a Harlequin hand collecting the ball but then by Tom Stephenson slipping while trying to make the tackle.
When all was said and done Sam Smith had a simple stroll in to the uprights and Botica the straightforward conversion.
But if Saints were shaken by the set-back it didn't show, and within three minutes they were back on the scoreboard with Lamb's second penalty. Those three points were earned by a superb scrum from the Saints pack and the home backs were looking dangerous, too, Burrell making metres whenever he got the ball and Scott Armstrong making a couple of powerful runs down the right wing.
Saints were being guilty of getting carried away by their own ambition, and while on a couple of occasions they came close through Calum Clark and Jamie Elliott there were also times when someone looked for the money pass rather than the simple option and possession was handed back to the visitors.
Saints very much on top in the scrum, but the breakdown was much more even, not least because referee Welshman Neil Hennessey was keen to see a good contest for the ball, penalising attackers for holding on as much as infringing defenders.
For all the venom with ball in hand it was a defensive mishap which handed Harlequins their second try. The home lineout had been solid up to this point, but when a throw 10 metres out just eluded the soaring Mark Sorenson, not to mention both Stephenson and Burrell, Quins pounced and Harry Sloan reached over for the score.
Botica once again had the simple extras, and after having played reasonably well for 25 minutes just two errors had given Harlequins a 14-6 lead.
Defensive solidity stopped the visitors' pack finishing off a powerful maul, but once again a mistake handed Harlequins an unopposed score. Lamb had hit an upright with his third attempt, but it was a floated pass which proved far more costly.
Dummy runners had held the Quins midfield defence and created a two-on-one overlap on the right wing, but Smith had other ideas, snatching an interception and sprinting in from 50 metres.
However Lamb did have the last say of the half, rewarding yet another powerful scrum with his third penalty, and the first points of the second period, too.
This not just got Saints within nine points but inadvertently created a try for the hosts, too. Burrell may have seen the kick off slip through his hands, but with several chasers also challenging for the ball it left plenty of space for Jamie Elliott to sprint clear. May was in support, as was Burrell, and the centre's power took him over.
Botica took Harlequins out to a converted try with a penalty six minutes later, but on the stroke of the hour mark Lamb levelled up the scores with a superb touchline conversion.
Burrell was involved a couple of times, making dents into the visitors' rearguard, and gave the scoring pass to May, who squirreled over in the left corner.
Five minutes later Saints were in front courtesy of another great scrum and three points from Lamb's right boot.
And while a neat drop-goal from the fly half took Saints six points clear it could have been more had Roberts managed to get the ball down a few minutes earlier. GJ Van Velze had made the initial metres, with the rest of the pack edging closer around the fringes.
But although the drop-goal was no less than the hosts deserved it still left Harlequins with three minutes to stage a dramatic comeback. The first attempt ended with a Hopper fumble, but there was no such luck the second time.
Quins attacked from deep, and with Ethan Waller yellow carded for killing the ball the visitors had the extra man and the crucial score, too, Botica sidestepping his way to the try. The conversion went over and the Gardens was stunned.
2mins SAINTS Pen Lamb 3-0
7mins QUINS Try Smith Con Botica 3-7
10mins SAINTS Pen Lamb 6-7
25mins QUINS Try Sloan Con Botica 6-14
31mins SAINTS Miss pen Lamb
33mins QUINS Try Smith Con Botica 6-21
40mins SAINTS Pen Lamb 9-21
HALF-TIME SAINTS 9 HARLEQUINS 21
48mins SAINTS Pen Lamb 12-21
48mins SAINTS Try Burrell 17-21
54mins QUINS Pen Botica 17-24
59mins SAINTS Try May Con Lamb 24-24
64mins SAINTS Pen Lamb 27-24
76mins SAINTS DG Lamb 30-24
80mins SAINTS Yellow card E Waller
80mins QUINS Try Botica Con Botica 30-31
FULL-TIME SAINTS 30 HARLEQUINS 31