Both teams started well with chances from Pedro Obiang, Lukaku, Manuel Lanzini and Barkley in the first period, but it remained goalless.
Lukaku opened the scoring five minutes after the restart, Michail Antonio and Mark Noble came close to an equaliser, but Barkley sealed the win with his effort.
Starting off brightly
Both sides went into the clash at Goodison Park needing with the Hammers looking to continue their good run, and the hosts looking to return to winning ways.
It was Slaven Bilic's men who started brightest, Payet played it through to Obiang, it looked easy to score for the midfielder, but he managed to blaze it over the crossbar.
Everton had their first sniff at goal in the 21st minute, Idrissa Gueye's trickled through to Lukaku, but the pace of the ball proved too much for the Belgian as the ball got away from him.
It was a end-to-end affair, with Hammers going up the field with Lanzini, who easily made it past Ramiro Funes Mori but his effort from the tight angle was just wide.
Adrian was called into action just before the half-hour mark, Barkley received the ball 10 yards out and made space for himself but the keeper produced a strong hand.
Great start to the half
Ronald Koeman's side came flying out of the traps in the second period, and it only took five minutes for them to open the scoring.
It all came from Yannick Bolasie, as he reacted quickly to Seamus Coleman's shot been parried, he put it back across and Lukaku headed home from a few yards out.
Barkley nearly made it two in 56th minute, Winston Reid's stepping off allowed him to curl a effort towards goal but it was just over the target.
Getting back in it
As the clock ticked down, the away side continued to push for a way back into the clash.
Ashley Williams will have been counting his blessings in the 66th minute, his slips sees Antonio through, he tried to recover but luckily for him Antonio's effort was saved by Joel.
Captain Noble looked to rejuvenate his side with a effort on 70 minutes, he tried it from the edge of D but it was easy Joel.
With 14 minutes to play, the three points were wrapped up for the Toffees with their second goal of the afternoon.
He started the move as he clipped the ball to Lukaku, the Belgian did well to hold of Gabriel Ogbonna and his ball to the back post was easy enough for Barkley to finish on the half-volley. That was how things stayed as Everton got back to winning ways, as the Hammers ended a turbulent week with defeat.