A stunning extra-time strike from Gary Cahill helped to book Wanderers' place in the fourth round of the Carling Cup.
Gary Megson's side showed great character and class to fight back from a goal down and eventually prevail 3-1.
After a lively but scoreless first half, Herita Ilunga prodded West Ham into the lead on 58 minutes.
But Wanderers pressed for an equaliser that eventually came eight minutes before the end of normal time through the head of Kevin Davies.
With the wind under their sails, Gary Megson's men took the momentum into extra time, where Cahill's sublime 20-yard half volley put the Whites 2-1 ahead.
And in the 119th minute, substitute Elmander converted Chung-Yong Lee's low cross to seal the win and dismiss the East London side from the competition.
With Ivan Klasnic and Ricardo Gardner making such an impact in the weekend's draw with Stoke, Gary Megson handed both starting berths at the expense of Gretar Steinsson and Tamir Cohen.
There was a frantic opening to proceedings with both teams having the chance to put themselves ahead within an action packed first few minutes.
Wanderers' first corner of the game was half cleared and after Ricardo Gardner and Kevin Davies had exchanged passes, Zat Knight had a goal-bound shot charged down by Jonathan Spector.
West Ham broke immediately and forced Jussi Jaaskelainen into three decent saves before a Scott Parker thunderbolt from 25 yards flew fractionally wide of the post.
The signs were certainly there that the game had the potential to be full of goals after what was proving to be a very open start. Before the 15-minute mark was up, Matt Taylor had blazed over the bar, Knight forced Robert Green into a smart save from a Sam Ricketts cross and Gary Cahill's glancing header floated the wrong side of the upright.
But for Bolton's extremely bright start, West Ham were also looking lively on the counter attack. A well disguised slide-rule pass from Parker released striker Zavon Hines, whose finish was again well saved by the on-rushing Jaaskelainen.
The pace simmered slightly as the half wore on but there was still the opportunity for Klasnic to get his Bolton tally up and running on 26 minutes. Davies showed great endeavour to force his way through a packed Hammers' penalty area and cut the ball back across goal for the Croatian, who was unable to find the back of the net.
Like all good strikers, Klasnic had known what position to occupy inside the penalty area, and just two minutes later he again found himself in the perfect place to out-jump James Tomkins and direct a powerful header towards goal which Green had to palm over the bar at full stretch.
Gary Megson's side had undoubtedly bossed the first half and had generally contained West Ham's pacey attack. However eight minutes before the interval, the highly regarded Hines did find space inside the area and fired in an effort that would have certainly caused problems for Jaaskelainen if it hadn't spurned off a defender and missed the goal by just a couple of yards.
After such an eventful first half, no changes were deemed necessary by either manager at the break.
Bolton were the quickest out of the blocks, and twice Green had to be on his guard to palm attempts for corners within five minutes of the restart. The first - a sliced right-footed shot from Klasnic - was tipped over the bar before a dangerous in swinging cross by Taylor had to be cleared to prevent Davies from nodding the Whites ahead.
Then against the run of play, West Ham forced themselves ahead in bizarre fashion on 58 minutes. A near post corner by Italian Alessandro Diamanti was sliced across goal by Matt Taylor, who was attempting to clear the danger with his left foot. Unfortunately the ball evaded almost everyone inside a packed area apart from Herita Ilunga and the full-back bundled the ball into the net from close-range.
Bolton's response to going a goal behind was encouraging and they could have been back level within the space of five minutes through the skipper. Having picked the ball up midway inside the Hammers' half, Davies opted to try his luck from distance and his 25-yard fizzer skimmed the roof of the net.
Chung-Yong Lee was introduced for Ricardo Gardner, who was still feeling his way back to fitness following a five-week lay-off with a hamstring injury. Gary Megson also opted for a like-for-like attacking change in the latter stages as Johan Elmander made his first appearance since injuring his calf on international duty.
The two changes helped to start a period of play in which Taylor saw a skidding shot deflected wide and Bolton force a number of successive corners. But on each occasion, West Ham's defence held strong with Robert Green making a couple of confident catches to thwart Wanderers' efforts.
Then, with five minutes remaining, Wanderers finally breached the Hammers defence as Kevin Davies scored the equaliser that Wanderers had deserved.
Taylor's corner was the perfect height for the skipper, who stooped to head low into the corner of the net. It was Davies' fourth goal in as many matches against the Hammers and a strike that took the match into extra time.
The Trotters were in the ascendency after their late leveller and they continued that momentum into the start of the extra 30 minutes. Matt Taylor scored two splendid free-kicks against the Hammers last season and he was a lick of paint away from making it three in succession with a 30 yard set-piece that struck the base of the post.
But Bolton weren't to be denied for much longer as Gary Cahill blasted his team ahead with an unstoppable 20-yard half volley. Again captain Davies played a pivotal role, nodding the ball down excellently into the path of Fabrice Muamba. The midfielder's shot was charged down and Cahill seized on the rebound, smashing a first-time effort into the roof of the net.
There could be absolutely no complaints from the visitors because they had rarely ventured out of their own half in the first period of extra time. Indeed, it could have been 3-1 to the Whites if Green hadn't been alert to tip Muamba's exquisite chip over the crossbar.
Diamanti struck the crossbar late on with a thunderous left-foot shot, but Wanderers still believed they could add to the scoresheet and they did through Elmander in the 119th minute. Lee Chung-Yong, who had been simply outstanding since his introduction midway through the second half, dribbled past Tomkins and crossed perfectly for the Swede who notched his first goal of the season and booked Wanderers place in the third round in the process.
Bolton: Jaaskelainen, Samuel, Ricketts, Cahill, Knight, Taylor, Gardner (Lee 69), McCann (Cohen 82), Muamba, Klasnic (Elmander 73), Kevin Davies (Subs: Al Habsi, Steinsson, O'Brien, Mark Davies, Cohen)
West Ham United: Green, Dyer, Parker, Kovac, Noble, Spector (N'Gala 65), Diamante, Da Costa, Ilunga, Tomkins, Hines (Subs: Cole, Faubert, Nouble, Kurucz, Payne, Edgar)