Goals from Ki Sung-yueng and Mike van der Hoorn gave the home side a deserved 2-0 half-time lead, before Andy King and Jordan Ayew notched after the break to ensure that the Swans continued their rejuvenation under Carlos Carvalhal.
Swansea's fourth home league victory in a row moves them out of the relegation zone and into 13th place in the league table, level on 30 points with the Hammers.
David Moyes and his West Ham charges now face a real scrap to maintain their top-flight status this term.
The visitors started with the kind of lethargy one might expect after a lengthy coach journey to Wales, which came in stark contrast to an energetic Swans side who hassled and harangued their opponents from the off.
Andre Ayew was making his first start during his second spell at the club after his January move from the Hammers, and he soon combined with brother Jordan, only for his touch to let the former down at the vital moment inside the visitors' box.
Aiming to bounce back from their damaging defeat last week at Brighton & Hove Albion, the Swans soon took the lead after eight minutes, when the returning Ayew fed Ki on the edge of the area, leaving the South Korean to drive an adroit finish past Adrian from distance.
The home side were almost two ahead moments later too when a melee in the box from a corner saw both Adrian and Declan Rice react superbly to thwart both Van der Horn and Federico Fernandez on the line.
The mix-up in the box proved to have more troubling consequences for the visitors, though, as Winston Reid found himself in agony on the deck after twisting his body in the action. The injury led to a nine-minute stoppage before the centre-back was eventually stretched off to a standing ovation from both sets of fans.
The Hammers' early languor continued throughout the rest of the half and they were punished again in the 32nd minute, this time as Rice fell asleep at the back post, allowing Van der Hoorn to steal in and score only his second career goal to put the Swans two ahead at the break.
Moyes clearly had words with his men during the interval and they responded with some promising early energy, before being undone by a killer blow just a couple of minutes after the whistle. A corner was initially met by Ayew, before the ensuing rebound fell kindly to King, who prodded home from close range to register on his first start for the club.
A shambolic afternoon was to get worse for the Hammers too, when Ayew returned to haunt his former club by winning a cheap penalty off Cheikhou Kouyate after the hour mark, allowing his brother Jordan to step up and convert the spot kick beyond Adrian to make it 4-0.
West Ham were able to leave Wales with a sliver of respectability, however, as substitute Michail Antonio profited from Aaron Cresswell's free kick in order to earn a late consolation for the visitors with a simple finish from close range.
The win for Swansea sees the Welsh club head into another huge fixture against fellow strugglers Huddersfield Town with at least some sort of gap from the bottom, while West Ham's home game against Burnley comes into sharper focus for Moyes and his men after a humbling defeat.
SWANSEA CITY (4-4-2): Fabianski; Naughton, van der Hoorn, Fernandez, Mawson; Olsson, Ki, King (Carroll 81'), Clucas (Abraham 90'); J. Ayew, A. Ayew (Dyer 78')
WEST HAM UNITED (3-4-3): Adrian; Reid (Byram 27'), Rice, Cresswell; Zabaleta, Evra (Antonio 46'), Noble, Kouyate; Lanzini, Arnautovic, Hernandez