West Ham took the lead in the first half when Ravel Morrison scored his first Premier League goal for the club.
But Everton rung the changes at half-time with Romelu Lukaku and James McCarthy entering the fray.
But it was Leighton Baines who stole the show with two sublime free-kicks from almost identical range, both leaving Jussi Jaaskelainen with no chance.
In between his two strikes came a penalty finish for Mark Noble, after being hauled down by McCarthy, which made the score 2-1 to the home side.
But Noble went from hero to zero when his foul on Ross Barkley saw him receive his second bookable offence and his subsequent marching orders - the foul also led to Baines' second goal.
Lukaku was the hero however, putting his body on the line for the winner. His header in the 85th minute meant Everton remain the only unbeaten team in the league, even if he was knocked unconscious achieving the feat.