The visitors left it until the final five minutes before Demetri Catrakilis kicked the winning penalty.
It was Quins that broke the deadlock through Cadan Murley's sublime try in the corner, but Bryce Heem levelled matters soon after.
Marcus Smith's three-pointer for Quins was the only other score of the opening half and that was later eclipsed when Tom Howe touched down.
The Warriors appeared to be pulling away when Duncan Weir made it 13-8 from the tee, but Ben Tapuai dotted down and Catrakilis added the extras.
Weir's penalty then put the hosts on the brink of victory as the balance shifted again, but there was one final twist as Darren Barry was whistled for offside and Catrakilis kept his cool to split the posts.
Quins will now face the winner of Monday's (AEDT) match between Clermont and Northampton Saints.