A crazy game at Upton Park saw the hosts go ahead twice, the second time on a penalty from Mark Noble, who was sent off shortly afterwards for a second yellow card
Young English midfielder Ravel Morrison gave the hosts the lead at Upton Park in the first half as his shot took a significant deflection, but the left back drew the visitors level in the 62nd minute with the first of his sublime set-piece goals.
A Mark Noble penalty looked to have secured a win for the home side with 14 minutes remaining but the midfielder was then dismissed after picking up a second yellow card and Baines fired in the resulting free kick before debutant Lukaku headed home the winner.
Sam Allardyce, whose side has not won since the opening day, was forced into one change from the side that drew 0-0 at Southampton in its last fixture as the injured Guy Demel was replaced in defense by debutant Razvan Rat, a close-season signing from Shakhtar Donetsk.
Everton impressively defeated Chelsea 1-0 on Sept. 14 for its first win of the season and Roberto Martinez felt no need to upset the rhythm of his team as he named an unchanged side.
The hosts finally registered a shot on goal, only their seventh of the season, after 31 minutes and it handed them the lead.
Matthew Jarvis cut inside from the left with purpose and shaped to shoot before laying the ball off to Morrison, whose effort was taken past the helpless Tim Howard thanks to a big deflection off Phil Jagielka.
Martinez reacted at halftime by bringing James McCarthy and Chelsea loanee Lukaku on for Steven Naismith and Nikica Jelavic. He was soon forced into another change as Bryan Oviedo replaced the injured Leon Osman.
Baines found his range just past the hour as Barkley won a free-kick just outside the area and the 28-year-old stepped up and curled a magnificent strike into the top corner of the goal.
Everton was not level for long, however. McCarthy tripped the rampaging Kevin Nolan in the penalty area 15 minutes from time and Noble converted from the spot.
A few minutes after being the hero, Noble found himself walking down the tunnel. A wild lunge on Barkley saw him given his marching orders and it proved costly as Baines once again stepped up and fired the free-kick home after 83 minutes.
And just two minutes later, Mirallas broke free down the right and crossed for Lukaku, who powered a header past Jaaskelainen to take Everton up to fourth.