Boselli has been regarded as something of a flop since he signed for the Latics for £6million, scoring twice in a two-year spell that has seen him make just 14 Premier League appearances.
The former Estudiantes man showed flashes of brilliance on Tuesday night, though, with his second goal – a lovely chip from inside the area – the pick of Wigan’s four goals on what was otherwise a third-round tie very short on quality, particularly from the home side.
West Ham, who had only lost one of their previous six games this term, went ahead through Modibo Maiga, but they quickly wilted to allow Wigan to open up a two-goal lead.
Boselli capitalised on some slack marking to tap home from close range after 14 minutes and then Ivan Ramis blasted home from 25 yards before Boselli’s wonder chip made it 3-1.
The Hammers showed little sign of fight in the second half, and Wigan killed off the game with seven minutes to go when Jordi Gomez scored a penalty after Stephen Henderson brought down James McArthur in the box.
All the early signs pointed towards a West Ham victory as the Hammers started confidently.
James Tomkins and Mark Noble, who earlier signed a new three-year contract, threatened the Wigan defence with two early attacks and the Hammers took the lead with just six minutes gone.
Maiga pinched the ball off McArthur while the midfielder dallied on the ball and surged towards goal before unleashing a 20-yard drive that slotted neatly into Ali Al-Habsi’s bottom right-hand corner.
Al-Habsi had to be at his sharpest to deny James Tomkins at the near post as West Ham pushed for a second, but Wigan suddenly sprung in to life and started to take a grip on the game that never loosened.
David Jones stung the palms of Henderson with a free-kick from an acute angle and Boselli headed just wide.
The Argentinian made amends for his miss when he pulled Wigan level after 14 minutes thanks to some slack defending from the hosts.
Maynor Figueroa was given far too much time on the left flank and he swung in a deep cross that Boselli tapped in from close range after giving Jordan Spence the slip.
Debutant Robert Hall was the only bright spark for the hosts. The 18-year-old dazzled the Wigan defence with his trickery and drove just wide with a 25-yard effort.
West Ham were all over the place in midfield and, had it not been for some dithering by Callum McManaman, Ryo Miyaichi would have had a chance to make it 2-1 after he raced through.
In the end it mattered little as moments later Ramis put the Latics ahead. Two West Ham players backed made pitiful efforts to dispossess the Spaniard as he charged towards the box before unleashing a 25-yard drive that beat Henderson with ease.
Three minutes later Wigan were 3-1 up. The Hammers defence allowed Jones too much time on the ball and he slipped a delightful pass through to Boselli, who beat the offside trap and lifted the ball over Henderson from 12 yards with a cheeky chip.
Hall ploughed a free-kick almost in to the second tier to sum up West Ham’s futility and the home fans booed their team off at the break.
James Tomkins headed a free-kick back across the box and Maiga just missed the tap in, but otherwise West Ham continued to disappoint.
Wigan were not content to sit back and kept pushing for a fourth.
Boselli slipped Miyaichi in to the box and he pulled the ball back across the six-yard box but no-one was there to finish.
Sam Allardyce looked to Matt Taylor for inspiration, the former Bolton man coming on for Noble with 20 minutes left.
The change had little effect, though. Henderson denied Boselli a hat-trick by saving low to his right, but West Ham then went up the other end and almost pulled one back when Hall’s deflected shot clipped the bar.
Worryingly for West Ham, Gary O’Neil then hobbled off with an injury.
The game was then put beyond doubt when Henderson’s clumsy challenge on McArthur caused referee Craig Pawson to point to the spot.
Substitute Gomez denied Boselli the opportunity to finish off with a hat-trick, but the former Swansea loanee made no mistake himself from 12 yards, slotting the ball confidently to Henderson’s right.
A mass exodus followed and those who remained booed their team off the pitch at full-time.