They enjoyed the better of the first half but were pegged back to 1-1 not long before the break.
David Connolly marked his return to the team by putting the Hammers ahead on 19 minutes, drilling the ball home from six yards for his eight goal of the season.
Unfortunately west Ham's recent habit of losing a goal's advantage returned with eight minutes to go before half time when Delroy Facey slotted home from close range following good work from Ian Moore.
The teams left to a somewhat surprising chorus of boos.
The game came to life late in the day as Ian Moore put the visitors ahead on 82 minutes with a right foot shot from six yards out.
To the Hammers great credit they threw themselves into getting back into the game, and with just four minutes to go Don Hutchison sent the crowd into raptures with a fabulous left-footed volley from the edge of the area
The game had a frantic finish as the home side went for the win, and Defoe hit the post deep into injury time, although he was ruled offside.
Again, there were boos at the end but the Hammers played much better than against Norwich, but nevertheless they have only picked up two home points this week. The Trevor Brooking caretaker era has ended on a slightly downbeat note, but the side are still in a healthy state as Alan Pardew's reign begins.