The Maltese minnows, who qualified for the Europa League by winning the FA trophy in their homeland, frustrated the Premier League side until Tomkins bundled home a corner late on.
Hammers boss Slaven Bilic took charge of his first game from the home dugout and named a strong senior side that included Mark Noble, Kevin Nolan and Aaron Cresswell.
Modibo Maiga was twice denied in the first half by goalkeeper Justin Haber but that pressure faded and a goal never looked likely in front of a frustrated home crowd, until Tomkins struck.??
West Ham were expected to make short work of their opposition, having seen off FC Lusitans of Andorra 4-0 on aggregate in the first round.
Birkirkara headed to east London with former Juventus striker Fabrizio Miccoli in their ranks but offered almost nothing in forward areas early on.
It was one-way traffic almost from the kick-off, but without the killer finishing touch.
Maiga headed over and then Amalfitano curled the ball high into the Sir Trevor Brooking Stand from 12 yards out.
On 20 minutes, Birkirkara goalkeeper Haber produced a brilliant one-handed save to tip over a point-blank header from Maiga following a free-kick into the penalty area.
Maiga then angled a 20-yard shot that was touched onto the far post by Haber.
After a tactical reshuffle at the break, Birkirkara were far more organised and crafted a rare break when Ellenton Liliu scampered clear down the right but he dragged his cross-shot wide.
West Ham looked to have run out of ideas but Haber flapped at a left-wing corner swept in by Zarate and Tomkins bundled the ball into the net, enabling Bilic’s men to take a narrow advantage to Malta for the second leg next Thursday.