The Saracens and England fly-half had endured a miserable night with his goalkicking, missing four shots at goal from six attempts, including three from around Gloucester's 22-metre line. But he came up trumps when it mattered as Saracens moved 14 points clear at the Premiership summit.
Farrell, though, could face an anxious wait after a high shoulder-led challenge on a Gloucester player five minutes from time might yet attract the citing commissioner's attention. England kick off their Guinness Six Nations campaign against Scotland at Twickenham on February 4.
Farrell booted two penalties, while wing Max Malins and scrum-half Ivan van Zyl scored tries, yet his opposite number Santiago Carreras enjoyed an 80 per cent success rate, landing three penalties and a conversion of wing Ollie Thorley's first-half try.
Former Newcastle hooker George McGuigan made his first Gloucester start, but the West Country club were without a number of injured players including wing Louis Rees-Zammit, fly-half Adam Hastings, hooker Santiago Socino and lock Alex Craig.
Saracens showed six changes from the side that crushed Exeter last weekend, including first starts of the season for centre Duncan Taylor and scrum-half Aled Davies, while wing Alex Lewington made his 100th appearance.
New England boss Steve Borthwick and Red Rose defence coach Kevin Sinfield looked on as Saracens exerted pressure from the kick-off.
Prop Mako Vunipola went close to a try after flanker Ben Earl charged clear from a lineout, and the visitors breached Gloucester's defence through a seventh-minute touchdown for Malins.
Saracens oozed authority, yet Gloucester rocked them through an impressive response. Number eight Ben Morgan had a try disallowed after Gloucester's forwards drove over from close range, with referee Karl Dickson ruling that McGuigan had executed a dummy lineout throw.
But Gloucester struck from their next attack as Thorley showcased blistering pace as he smashed through two tackles on a 50-metre run to the line, and Carreras' conversion made it 7-5.
A Farrell penalty nudged Saracens back in front, only for Carreras to restore Gloucester's advantage, but the England fly-half struck again two minutes before the break and secured a one-point interval advantage.
Gloucester, meanwhile, were forced into a change as full-back Lloyd Evans left the action injured, with Tom Seabrook replacing him. Prop Val Rapava-Ruskin also departed injured, yet Gloucester showed no sign of disruption as a Carreras penalty made it 13-11 five minutes into the second period.
Carreras was then obstructed by Saracens full-back Alex Goode after be broke clear - Goode was yellow-carded - only for the fly-half to miss the resulting penalty from just 20 metres out.
Farrell's accuracy also let him down, though, hitting a post from a short-range penalty attempt, then drifting another straightforward chance wide as Saracens attempted to regain the initiative following Goode's return. And they claimed a second try 14 minutes from time after Farrell's kick caused uncertainty in the Gloucester defence, before a slick handling move saw Van Zyl cross wide out.
Farrell missed the conversion on a night to forget off the tee for him, and Saracens led by three points entering the closing stages. But another Carreras penalty tied things up eight minutes from time, before Farrell kept his composure amid intense pressure and Saracens could celebrate an 11th league win from 12 starts this season.
Additional reporting by PA.