Saracens had won their first three games of this campaign and had not lost to Harlequins in the league since January 2020.
Fin Baxter's try gave Harlequins a 7-0 half-time lead before Saracens' Hugh Tizard dived over against his former club to level the score in the second half.
Quins centre Lennox Anyanwu replied with a crucial score before Marcus Smith of Harlequins and Alex Lozowski of Saracens exchanged penalties in the closing stages.
Harlequins staged a stirring rearguard action under intense pressure for the victory.
Saracens suffered an injury blow when Scotland lock Andy Christie was stretchered off with only seven minutes gone.
