Birthday boy Dimitar Berbatov gave the hosts the perfect start thanks to a controversial opening goal after just 10 minutes.
However, the visitors hit back three minutes into the second half with Kevin Nolan netting to restore parity, but the lead lasted just 33 seconds as Hugo Rodallega fired the Cottagers back in front.
And Martin Jol's side made sure of all three points after an unfortuante own goal by Joey O'Brien in stoppage time.
Jussi Jaaskelainen was forced into action in the eighth minute, parrying away a fierce Bryan Ruiz effort from 20 yards.
Fulham pressed and soon broke the deadlock, with Berbatov nodding home just 10 minutes in. Damien Duff sent across a free-kick from the right, which looked to take the slightest of touches off Ruiz as it made its way to Berbatov to head home.
It was a moment of luck for the hosts as the Bulgarian was offside when the ball was whipped in - something the forward seemed aware of given he looked at the linesman before celebrating.
West Ham showed impressive fight by the Thames, levelling things up through captain Nolan in the 48th minute.
Mark Noble played a quick free-kick that caught the hosts off guard and Nolan did well to fire a low left-footed strike from an acute angle past Mark Schwarzer.
Parity lasted for just a minute, though, as Duff burst down the left flank and sent in a cross that Rodallega reached ahead of West Ham's defenders to bundle home.
Andy Carroll replaced his former Liverpool team-mate Joe Cole and forced Schwarzer into action moments into his first appearance since November 28th.
But the victory was secured in stoppage time when O'Brien inadvertently put into his own goal from Mladen Petric's cross-shot.
It was just Fulham's second league win of 2013 as they moved above their opponents into 12th position in the standings.