Farrell scored all 18 points for the visitors, with six penalties, in a hard-fought encounter at the Twickenham Stoop.
Harlequins, knocked off the top of the table when Northampton beat Wasps on Friday night, replied with an opportunist try from scrum-half Danny Care and 11 points from the boot of fly-half Nick Evans.
But the usually dependable former All Black missed three kickable second-half penalties, any one of which would have been enough to preserve Quins' 100 per cent record this season.
Evans kicked Harlequins into a second-minute lead but six minutes later he saw a second attempt rebound off the post after Sarries flanker Will Fraser pulled down a rolling maul.
Saracens drew level in the 12th minute with Farrell's simple opening penalty after Harlequins strayed offside.
Two minutes later Evans restored his side's lead with his second successful kick.
Farrell equalised again in the 21st minute after former England number eight Nick Easter was penalised for not rolling away from a ruck.
The first try-scoring opportunity was wasted by Quins. Evans found Easter but, with full-back Mike Brown outside him, the back-row man's final pass went straight into the arms of Saracens' England wing Chris Ashton.
quick break out of defence put Sarries on the front foot when Farrell and hooker Schalk Brits combined to release Ashton down the right touchline but he was superbly tackled into touch by Brown.
Harlequins hit trouble when they lost hooker Joe Gray to injury, had lock Ollie Kohn sin-binned and fell behind to Farrell's third penalty.
Gray's game ended in the 28th minute when he was replaced for the second time by Rob Buchanan, only four minutes after returning to the pitch following a 14-minute blood-injury absence.
Five minutes later referee Andrew Small showed Kohn the yellow card for killing the ball near his own line and Farrell landed the resulting penalty.
But 14-man Quins put the misfortunes behind them when Care, looking far more lively than England scrum-half rival and opposite number Richard Wigglesworth, scored a real sniper's try.
Exploiting a rare gap in the Premiership's meanest defence, he dashed clear to touch down near the posts, leaving Evans a simple conversion.
Farrell reduced Quins' lead to a single point with a 45-metre penalty four minutes into the second half.
Then hooker Brits produced a touch of magic worthy of a half-back when he found space and directed an inch-perfect kick into the corner for the chasing Ashton but he was once again thwarted by Brown's first-class covering.
Evans missed a 52nd-minute penalty kick for Harlequins and, three minutes later, Farrell kicked the visitors ahead after Quins were penalised at the breakdown.
Evans was off-target again in the 62nd minute after Sarries' replacement prop Mako Vunipola was penalised for entering a ruck from the side.
But Evans made no mistake from in front of the posts in the 66th minute after Saracens' replacement lock George Kruis, who had only been on the pitch for 12 minutes, was yellow-carded for hands in the ruck.
Evans then missed another penalty shot before Farrell kicked the winner in the 74th minute.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.