The Premiership side had to wait until 12 minutes from time for the goal from Tony Cottee which cancelled out the Third Division team's early lead. That had been gifted to them by a mistake by Steve Mautone, a 25-year- old Australian goalkeeper recalled from loan at Crewe as a late replacement for the injured Ludek Miklosko.
West Ham arrived with a record of just one win in their previous six games, the last of which, against Wimbledon, produced a defeat so dismal that it left their manager, Harry Redknapp, close to despair. "Our defenders must learn to defend and our forwards must start scoring," Redknapp said after the Upton Park upset.
There was no sign of that in the first half where West Ham did little more than go through the motions. There were only six non-English players in their team, a relatively homespun selection forced upon them by injuries to Paulo Futre, Florin Raducioiu and Ille Dumitrescu's call-up for Romania.
Julian Dicks, a player upon whom West Ham rely on awkward occasions such as this, alarmed the home side after just 12 minutes with a characteristically powerful drive.
However, any expectations that may have roused among the visiting supporters were dashed within a minute. A 25-yard shot from the Barnet left-back, Shaun Gale, bounced off Mautone's chest, and Phil Simpson reached the rebound first to roll the ball over the line. Simpson required treatment for two minutes as a result of his efforts.
The injury to West Ham's morale appeared more severe. Five minutes from half-time, West Ham's defence - in which Slaven Bilic, who has accepted a new contract with the club, appeared a destructive figure - was again left wide open. Pardew's long-ball gave Kevin Rattray time and space to measure a shot which he struck tamely within reach of the keeper.
West Ham, resuming with the benefit of both the wind and Underhill's 15ft slope in their favour, improved. Stan Lazaridis, a half-time substitute, attempted to redress the wrongs of his compatriot at the other end. Two flashing drives, and a cross which Cottee drove narrowly over, did something to raise West Ham's spirits. The visitors, however, relaxed again after 65 minutes when David McDonald sent Sean Devine clear for a shot which Mautone did well to block.
Lazaridis was rewarded for his enterprise in the 78th minute when his left-wing cross was headed in at the near post by Cottee.
Redknapp was quick to praise Lazaridis afterwards. His comments about Mautone, who had been preferred to Peter Shilton, 47 yesterday, after good reports from Crewe were more circumspect. "He made a ricket and he knows that," Redknapp said. "But it's an experience for him and he will learn from it."
Redknapp was satisfied with the way his side had set up next Wednesday's return leg: "If we can't beat Barnet at home we need locking up."
Barnet (3-5-1-1): Taylor; Primus, Pardew, Howarth; McDonald, Wilson, Codner, Rattray (Campbell, 59), Gale; Simpson (Tomlinson, 78); Devine. Substitute not used: Goodhind.
West Ham United (3-5-2): Mautone; Rieper, Bilic, Bowen; Breacker (Lazaridis, h-t), Moncur (Lampard, 77), Bishop, Hughes, Dicks; Dowie, Cottee. Substitute not used: Shilton (gk).
Referee: M Riley (Leeds).