Brendan Rodgers’ men were twice forced to come from behind on a bizarre evening at Craven Cottage.
A comical own-goal by Kolo Toure and another defensive error from central defensive partner Martin Skrtel allowed Kieran Richardson to grab Fulham’s second goal.
But Liverpool once again displayed their quality going forward and they needed that to turn around their fortunes in west London.
Daniel Sturridge netted for his seventh league game in a row — the first Anfield star to do so since the Premier League began — before Philippe Coutinho drew them level with 18 minutes remaining.
Then, in the final minute, Gerrard stepped up to beat Fulham substitute goalkeeper David Stockdale from the penalty spot after Sascha Riether brought down Sturridge.
That puts Liverpool to within four points of league leaders Chelsea after Arsenal drew with Manchester United.
With Manchester City’s game postponed, Liverpool had the chance to cut the gap to third place down to a solitary point.
Yet the red half of Merseyside struggled to get out of the blocks on a bitterly cold evening at Craven Cottage.
Within the opening 60 seconds, Ryan Tunnicliffe stung the palms of keeper Simon Mignolet with a shot from the right hand side of the penalty area.
That all came after ex-Liverpool left-back John Arne Riise launched a long ball downfield and Darren Bent, restored to Fulham’s starting line-up after his equaliser at Manchester United, neatly laid the ball off to Tunnicliffe.
Rene Meulensteen’s side gained encouragement from their start and young centre-back Dan Burn came close to breaking the deadlock when he rose highest to Lewis Holtby’s corner.
Liverpool looked a shadow of the side which had demolished Arsenal 5-1 at Anfield last weekend and they fell behind in the eighth minute in the worst possible fashion as Kolo Toure sliced his clearance into the net.
Holtby produced a slick pass beyond Martin Skrtel and Kieran Richardson’s cross was shinned home by the Ivorian centre-back.
It was the second mistake by Toure this month following his howler which gifted West Bromwich Albion a share of the spoils at the Hawthorns on February 2.
The hosts received a sudden shot of confidence and Holtby shot wide only a couple of minutes later.
Liverpool finally produced an attack of note in the 13th minute when Luis Suarez’s shot was turned around the post by Maarten Stekelenburg.
Seconds later, Toure’s evening went from bad to worse as he accidently clashed with referee Phil Dowd, knocking the official to the ground.
Although, the visitors appeared off-colour, the Reds still possess attackers of world-class quality. Suarez fired wide from an acute angle before strike partner Daniel Sturridge shot straight into the arms of a grateful Stekelenburg.
But there was nothing the Dutch goalkeeper could do four minutes before half-time when Gerrard sliced the Fulham defence open with a superb outside of the boot pass and Sturridge raced clear, steadied himself and then curled the ball home left-footed off the far post.
Considering how below-par Liverpool had started this game, it was a moment of relief for Rodgers and his side.
Suarez had little involvement on the opening period, but the 23-goal forward came to life after the interval.
His skill on Sascha Riether was simply sublime, flicking the ball beyond the Fulham right-back and latching onto the ball and starting another attack. In the end, Riether could only bring Suarez down.
From the resulting free-kick, Suarez went inches wide of Stekelenburg’s far post.
Steve Sidwell almost caught out Mignolet with an effort from the halfway line before the Uruguayan threatened the Fulham goal once more, but his left-footed strike flew agonisingly wide.
Meulensteen claimed pre-match that he was more nervous about going to the dentist than facing Liverpool’s fearsome strikeforce.
And Suarez provided another reminder of his talents when he fired a 20-yard shot against the outside of the post.
Yet, for all the Reds’ supreme forward play, they were let down once again by poor defensive work as Richardson fired the home side ahead from close-range.
Riether’s cross from the right did not look dangerous until Skrtel took the ball away from Flanagan and his sliced intervention landed into the path of Richardson, who slotted past Mignolet from three yards.
His shot did not appear like it would threaten Stekelenburg, but a deflection off Johnny Heitinga, formerly of Everton, did enough to beat the former Ajax stopper as the ball nestled into the bottom corner.
Stekelenburg had to be replaced when Suarez’s foot collided with his head.
Liverpool pushed for a winning goal late on, Coutinho not far away from connecting with Suarez’s cutback from the byline.
But then Gerrard showed an ice-cool temperament to score the last minute winner and spark wild celebrations among the travelling faithful behind Stockdale’s goal.
FULHAM: Stekelenburg (Stockdale 76), Riether, Riise, Kvist, Heitinga, Burn, Tunnicliffe, Sidwell, Bent, Holtby, Richardson (Kacaniklic 71).
LIVERPOOL: Mignolet, Flanagan, Cissokho, Gerrard, Skrtel, Kolo Touré, Coutinho (Agger 92), Henderson, Sturridge, Sterling (J. Teixeira 82), Suarez.
Referee: Phil Dowd.