The two sides were level at 1-1 heading into the final stages of the contest, but Soucek struck to make it 2-1 to the Hammers in the 91st minute, before Alvarez added a third for the London club five minutes later.
The result has left West Ham seventh in the table, just two points behind sixth-placed Manchester United, while Everton sit 16th, five points ahead of the relegation zone.
Beto was bright for Everton in the early exchanges, with the forward, who was making his first Premier League start since December, firing just wide of the post, before he came close to meeting a dangerous cross into the box, only for West Ham centre-back Konstantinos Mavropanos to make first contact.
Lucas Paqueta tried an inventive back heel from a James Ward-Prowse corner in the 14th minute, but Everton cleared the danger.
Amadou Onana was next to try his luck for Everton, striking from distance in the 24th minute, but his effort took a deflection and was kept out by West Ham goalkeeper Alphonse Areola.
The Hammers stopper was again called into action in the 26th minute to keep out an effort from Beto, with Everton looking the team more likely to make the breakthrough at Goodison Park.
The Toffees were awarded a penalty late in the first period for a handball on Kurt Zouma, with the referee sent across to the monitor to review the incident after taking advice from VAR.
Beto stepped up for the Merseyside outfit, but he was denied by Areola, with the goalkeeper diving to his left to make a smart save and keep the score goalless at Goodison Park.
West Ham had a half-chance early in the second period when Jarrod Bowen broke into the Everton box, but the forward was unable to get a shot away, and Toffees goalkeeper Jordan Pickford was on hand to collect.
The breakthrough eventually arrived in the 56th minute, with Beto making up for his penalty miss by heading a brilliant delivery from James Garner into the back of the net from close range to register just his second-ever Premier League goal.
Mohammed Kudus sent one wide of the Everton goal, as West Ham looked to respond, and the leveller came in the 62nd minute through Zouma, who headed a corner from Ward-Prowse into the back of the net.
Everton were on the front foot in the period that followed, with Dwight McNeil bringing a smart save from Areola, before Soucek cleared one off the line.
Areola was again called into action to keep out an effort from substitute Dominic Calvert-Lewin shortly after he had entered the field in the 74th minute.
West Ham's goalkeeper also denied McNeil and Andre Gomes in the latter stages, but there was to be late drama down the other end, with the Hammers scoring a second in stoppage time through Soucek, who found the far corner of the net with an excellent finish after meeting a cross from Kudus.
David Moyes's side were not finished, though, and netted a third in the 96th minute through Alvarez, with the Mexico international lifting the ball over the onrushing Pickford from inside the Everton box.
Everton will continue their Premier League campaign with a trip to Man United next Saturday, while West Ham will be in Europa League action on Thursday, facing a trip to Freiburg for the first leg of their last-16 clash, before returning to league duties at home to Burnley next Sunday.