Lee Tomlin’s 90th minute free kick secured a dramatic victory for a City side backed by an incredible travelling support at Craven Cottage.
In truth the visitors were out of sorts for 45 minutes and might have trailed by more than Ross McCormack’s brilliantly taken early opener.
But Lee Johnson made a double substitution at half-time that changed the complexion of the game.
Suddenly on the front foot, City drew level through Marlon Pack’s first goal of the season before Tomlin sent a beautiful free kick over the Fulham wall, which dipped at just the right moment to nestle inside the post.
Head coach Johnson made one change to his side beaten in the dying seconds at Wolves in midweek, handing a first start of his reign to Aaron Wilbraham as City adopted a 4-4-2 formation against a Fulham team having difficulties keeping clean sheets this season.
The risk and reward of the positive approach were clear to see as early as the first three minutes.
City attacked with purpose straight from kick-off. Joe Bryan had a clear sight of goal with which he did little wrong, striking the ball hard and low, but keeper Andrew Lonergan saved with his legs.
But within a matter of seconds the visitors were 1-0 down, as McCormack showed his obvious talent with a masterclass in finishing.
From an innocuous ball over the top, the Scot brought it down in an instant with his first touch and dispatched a quite brilliant lob with his second, sending his shot sailing over the head of Richard O’Donnell and nestling into the corner of the net just under the crossbar.
Having initially looked rocky, Fulham were suddenly engulfed by confidence. Ryan Tunnicliffe tried his luck from 25 yards before McCormack hit a free kick from even further out that flew through a sea of bodies and not far wide.
The Cottagers might be stuck in a relegation scrap but there can be no doubting the ability of some of their individuals.
Former England man Scott Parker tested O’Donnell from range, inviting Moussa Dembele to follow in the rebound after the keeper was unable to hold the initial shot.
When Dembele won the race to the loose ball and went down theatrically, the near 4,000-strong City following behind O’Donnell’s goal would have feared the worst as referee Phil Gibbs blew his whistle, but offside against the striker was the verdict.
It would take time for City to regain their composure, but the away supporters remained noisy and urged their team forward, resulting in a good spell on the half hour.
Scott Golbourne sent a teasing cross towards the far post where Jonathan Kodjia was just beaten to the flight of the ball, before Aden Flint’s glancing touch from a long throw dropped inches wide via a deflection.
When Nathan Baker headed the resulting corner just off target, the home side were looking vulnerable.
But McCormack came close from another free kick before the first half was out, serving as a reminder that City might have been faced with a bigger deficit at the interval.
Johnson was evidently unimpressed and responded with a double substitution before the restart.
On came Peter Odemwingie to make his City debut in place of Jonathan Kodjia, while Bobby Reid replaced Luke Freeman as Johnson switched from 4-4-2 to 4-2-3-1, with Odemwingie wide on the left.
Tomlin was now operating from the right flank but drifted infield to test Lonergan with a curling effort, sparking a big improvement from the visitors.
Tomlin delivered more telling corners, one of which flew over his own crossbar courtesy of Fulham defender Dan Burn, as the hosts lived dangerously.
But in Dembele they boast great pace on the break and when Odemwingie lost possession on the halfway line the Fulham frontman was bearing down on goal, only for O’Donnell to rush out and make a crucial stop.
The Stoke City loanee was recruited for his goalscoring instincts and he picked up a great position as he timed his run into the box, but former Ashton Gate man Ryan Fredericks threw his body in the way to make an important block.
Fulham must have been ruing their failure to turn sustained first-half pressure into more goals because City had their tails up and duly drew level in the 69th minute of what had become a very watchable game.
The goal was all about Pack. The midfielder has been given more licence to get forward under Johnson and was let off the leash as he charged towards the Fulham box.
With Odemwingie to his left, he used the forward as a decoy and instead turned inside and picked out the bottom corner with a precise low shot that beat Lonergan down by his right hand, sending City’s travelling army into raptures behind the goal.
The game had changed completely as a spectacle with the hosts now pinned back. Johnson’s wish for more crosses had been granted as Fulham’s back three were forced to cope with a barrage from wide areas, with Flint, Baker and Wilbraham all providing an aerial threat.
The natives were getting restless, summed up by collective boos at the withdrawal of Dembele in the closing stages, but replacement Cauley Woodrow came close to a dramatic goal that might have seen City leave West London with nothing.
Fredericks had hardly crossed the halfway line since the break but played a terrific one-two to escape Golbourne and cut the ball back for Cairney, who was denied by a vital O’Donnell save before Adam Matthews blocked heroically from Woodrow on the rebound.
It would prove a defining moment, as City went up the other end and won it. Bryan’s surging run was at the heart of it as the Bristolian won a free kick 25 yards from goal, prompting Tomlin to find the bottom corner and make himself a hero.
Still City had more defending to do, surviving a nerve-shredding period of stoppage time in which countless black shirts threw themselves on the line to protect three priceless points.