The Argentine's two goals either side of Ivan Ramis' stunner and followed by a converted penalty ensured the Hammers suffered League Cup elimination despite Modibo Maiga openerWigan Athletic came from behind to beat West Ham United 3-1 in the third round of the League Cup.
Sam Allardyce's side took the lead thanks to striker Modibo Maiga in the seventh minute, before a Boselli double either side of a fantastic Ivan Ramis strike in the first half secured the Latics' progress, with Jordi Gomez's penalty sealing the victory.
The Hammers began the better side and home fans will have been hoping for a tension-free evening when Maiga's strike inside the box nestled into the bottom left corner of the net.
But seven minutes later Boselli silenced the majority of Upton Park with a close-range finish from Maynor Figeuroa's hard graft.
The home side remained in control but Ramis fired in superbly from long distance to give the visitors a lead they never relinquished.
Three minutes later - and with half-time less than five minutes away - Boselli struck again for Roberto Martinez's men to ensure a two-goal cushion protected their qualification for the fourth round with the second half to come.
The second half was a more subdued affair as the visitors defended stoutly to prevent a Hammers comeback.
However, the win was wrapped up when substitute Gomez converted from the spot after West Ham goalkeeper Stephen Henderson brought down James McArthur unfairly in the area.