The Clarets came into the game on the back of the Boxing Day thumping at the hands of Everton and sitting in 19th position in the table, while West Ham had made it five wins from six at Southampton the following night.
The form guide pointed to an away win, but it was Burnley who collected the much-needed three points thanks to first-half goals from Chris Wood and Dwight McNeil who profited from some poor opposition defending.
The win takes the Clarets above Fulham and level on 15 points with Southampton in the final position of safety, while the Hammers are 11th on 27 points.
Burnley manager Sean Dyche made five changes to the side that was hammered 5-1 by Everton at Turf Moor in midweek with goalkeeper Joe Hart dropping out alongside Matt Lowton, Ben Gibson, Jeff Hendrick and Sam Vokes with captain Tom Heaton, Phil Bardsley, McNeil, Chris Wood and Johann Berg Gudmundsson coming in to replace them.
Meanwhile, Manuel Pellegrini made two changes to the side that started their 2-1 victory at Southampton on Thursday with captain Mark Noble replacing Pedro Obiang and Grady Diangana dropped out for fit-again striker Marko Arnautovic.
The Clarets started brightly and should have gone ahead in the second minute when Gudmundsson picked out McNeil down the flank and his cross dropped kindly to Ashley Barnes who hit a side-foot effort wide from eight yards.
Hammers keeper Lukasz Fabianski did well to palm away a McNeil header on eight minutes, although it wouldn’t have counted because the offside flag was raised.
West Ham’s first opportunity came a minute later when Angelo Ogbonna wastefully headed straight at Heaton when unmarked from a corner.
But it was Burnley who deservedly went ahead in the 15th minute when Ashley Westwood’s cross into the area was headed down by Barnes into the path of Wood and the striker controlled the ball before lashing his effort inside the near post.
The hosts continued to look the more likely to get the next goal as Ben Mee headed just over and Issa Diop put in a vital block to deny McNeil from hitting the target from 25 yards in the 24th minute.
It was no surprise when Burnley did go two-up 10 minutes later when West Ham failed to clear their lines properly and McNeil met a Westwood cross from the right and fired in from a tight angle.
They could have gone in at the break further ahead but McNeil spurned a good chance on 38 minutes when he put a shot wide with his weaker right foot and Fabianski pulled off another smart save to deny Wood on 45 minutes again without seeing the offside flag up.
Barnes had a chance to virtually wrap up the points within a minute of the second half getting under way when he was teed up by Wood, only to see his deflected effort go wide with the goal at his mercy.
Fabianksi was on hand to deny Barnes from close range on 50 minutes and four minutes later Wood was played through on goal by Westwood but toe-poked his effort just wide with the Hammers’ keeper beaten on this occasion.
Andy Carroll had West Ham’s first attempt of note in the second half on 67 minutes when Michail Antonio’s cross was deflected into the path of the big striker who curled his effort straight at Heaton from 20 yards.
Barnes had another effort tipped behind by Fabianski after being played through by Wood on 86 minutes, before Heaton produced a fantastic save to deny Carroll a consolation goal with a firm header from just six yards out a minute from time.