Burnley manager Brian Laws tasted victory for the first time since his appointment but it was a close run thing as West Ham will feel that their efforts deserved at least a point, instead of a 2-1 defeat.
Burnley started brightly and were rewarded for their early endeavours when a long ball from debutant Danny Fox found its way through to striker David Nugent, who calmly lobbed Robert Green.
West Ham strikers Carlton Cole and Benni McCarthy linked up well but the shots from debutant striker McCarthy were wide of the target.
McCarthy did however go desperately close to an equaliser when he was played in by Scott Parker and was unfortunate to see his shot cleared off the line by Leon Cort.
McCarthy failed to re-appear after the interval and was replaced by fellow debutant Mido, but it was the Clarets who extended their lead in spectacular fashion as left-back Fox struck a free-kick into the top corner, after Tyrone Mears had been brought down on the edge of the box by Jack Collison.
The Hammers almost pulled a goal back immediately as Parker's shot was somehow pushed behind for a corner by home goalkeeper Brian Jensen.
United striker Cole did have the goal in the back of the Burnley net, but it was rightly disallowed for off side.
Hammers substitute Junior Stanislas curled a free-kick from wide on the left on to the top of the Burnley crossbar and it came as no surprise when, with nine minutes remaining, West Ham pulled a goal back through Brazilian debutant Ilan.
That goal only served to add more tension to this six-point encounter and Gianfranco Zola's side almost grabbed a share of the spoils when Mido struck the post.
The win was Burnley's first in 13 Premier League games and has seen the Clarets leapfrog the Hammers in the table.