Hugo Cuypers, who scored in the 1-1 first-leg draw in Belgium last week, saw a 25th-minute opener cancelled out 12 minutes later by Michail Antonio, before three Hammers goals scored within seven minutes and 53 seconds early in the second half turned the tie on its head in remarkable fashion.
Lucas Paqueta converted from the penalty spot shortly after a stunning solo goal from Declan Rice, and Antonio then netted his second of the night to secure West Ham's place in the last four.
Twelve months on from reaching the Europa League semi-finals, David Moyes's has steered West Ham into the last four of another European competition this term, with their triumph over Gent setting up a semi-final clash with Dutch side AZ Alkmaar, who beat Anderlecht 4-1 on penalties following a 2-2 draw across two legs.
West Ham made a positive start to proceedings in the first half but they failed to create any clear-cut opportunities, before the first chance of the night fell to Gent top scorer Cuypers, who glanced a header narrowly wide of the post inside the opening 10 minutes.
Cuypers was not ruing that chance for long, though, as he capitalised on defensive calamities from West Ham to open the scoring on the 25-minute mark.
A sloppy pass in the middle of the park from Hammers midfielder Paqueta helped begin the attack for Gent, and the ball eventually fell to Matisse Samoise inside the area, who scuffed his shot to Cuypers and he bundled it into the net from close range.
West Ham responded well, though, and restored parity eight minutes before the break courtesy of a thumping header at the near post from Antonio following a whipped free kick into danger zone from Jarrod Bowen.
The Hammers came agonisingly close to taking the lead just three minutes after the interval when Bowen rolled a cross across the penalty area to Tomas Soucek, who smacked a powerful strike from around six yards out onto the face of the crossbar.
Antonio then rattled the base of the post just a few minutes later, but before the Hammers striker let fly, the ball stuck the arm of Gent defender Joseph Okumu, and on-field referee Orel Grinfeeld pointed to the spot following a look at the VAR pitchside monitor.
Paqueta stepped up from 12 yards and placed his left-footed strike into the top-right corner to make amends for his first-half mistake and put West Ham in front with just over half an hour remaining.
Less than two minutes later, Hammers skipper Rice picked up the ball from inside his own half and capped off a brilliant barnstorming run through Gent's midfield with a composed left-footed finish into the bottom corner, sending the London Stadium into pandemonium.
Antonio then netted his second and West Ham's fourth of the night in the 63rd minute, racing onto a through-ball from Paqueta before bending a powerful strike into the top-right corner.
Bowen thought he added his name to the scoresheet in the 72nd minute, but the attacker was deemed to have handled the ball before wriggling his way through a cluster of Gent defenders and firing a shot in off the post.
West Ham comfortably played out the final 15 minutes in front of a carnival atmosphere at the London Stadium, and Moyes's men can now look forward to the first leg of their semi-final tie at home against AZ Alkmaar on May 11.
The Hammers will now turn their attention back to the relegation battle in the Premier League with a trip to Bournemouth on Sunday, while Gent play host to Oostende in the Belgian Pro League.