West Ham's Said Benrahma came off the bench to dump former club Brentford out of the FA Cup in superb style and end his side's winless run at the seventh attempt
The Hammers winger, a former favourite in west London, struck from 20 yards with just 11 minutes to go to settle a third-round tie that was heading for a replay which neither side wanted
Benrahma's goal came from the visitors' first attempt on target as Brentford dominated the game at the Gtech Community Stadium, with Lukasz Fabianski making a superb save to deny Yoane Wissa from close range early on
Not even the introduction of new loan striker Kevin Schade could inspire a comeback for Brentford, who now have only Premier League football to play for this season
 West Ham, meanwhile, march on to round four after picking up their first win since November 3
"We've got something to build on now and hopefully we can get back on track," said West Ham manager David Moyes
 "It was important to stop conceding goals
 If you do that then you've always got a chance of winning
"I said in the press conference last week that we could do with someone scoring a screamer, well Said certainly did that
 His impact was excellent
"I could have easily started Said today
 We were thinking of starting Said today and we were umming and ahing on it
"David Moyes named a strong squad for this FA Cup tie, hinting that the Hammers are taking this competition seriously this season, despite sitting just one place above the relegation zone in the Premier League table
But it was a much-changed Brentford side that dominated from the start and created the only real chance of the first half - one which should have been put away by Wissa
The exciting Keane Lewis-Potter burst down the right to cross for his strike-partner, who was unmarked in the box, but the forward could only fire straight at Fabianski who rushed out at his feet
West Ham failed to create any shot on target in the first half but should have taken the lead at the beginning of the second with two big opportunities
First, Tomas Soucek somehow fired wide while unmarked inside the six-yard box following a good move down the left involving Emerson and Lucas Paqueta
 Craig Dawson then slipped at the far post after being found all alone by Paqueta's pinpoint free-kick
The tenacious Lewis-Potter continued to trouble the Hammers' defence, testing Fabianski's gloves with one rasping drive before dropping a header wide of the far post from Mads Roerslev's cross from the right
Brentford brought on new striker Schade, signed on loan from Freiburg this week, for Lewis-Potter but it was former Bees attacker Benrahma - introduced at the same time - who stole the show
Declan Rice pinched Wissa's pocket in the centre circle and the loose ball fell to Benrahma, who charged at the Brentford defence with a mazy run
Just as he did many times in red and white, Benrahma finished with aplomb and chose not to celebrate in front of his former employers
Brentford pushed for an equaliser in the final 10 minutes, with Schade seeing a shot deflected wide and Wissa missing from inside the box at the near post
But it was West Ham, who had lost their previous three outings against Brentford going into the game, who earned the London derby bragging rights this time
Despite going into the game sitting 17th in the Premier League table, Moyes would like to see West Ham have a go at the FA Cup
"I want a run in the cup, I want to try and go as far as we can," Moyes said
 "The cup would be a real bonus for us, getting our Premier League form correct is obviously a big priority though
"When you saw this draw in the FA Cup you thought: 'Wow what a difficult draw
' We're thrilled to be through and we want to have a go at it
"The Hammers boss did criticise the quality of the Brentford pitch for the FA Cup tie, which came three days after London Irish played a rugby match on the same turf
"It was a tough game
 The pitch is obviously not good at all
 It's not that easy to play on," added Moyes
"I don't want to get on over who is right [about whether a football club should share pitch with a rugby team]
 Brentford have a really good set-up, business model and how they do things
"They've also got a good football team and normally good football teams would like to have a good pitch
 Their players will be feeling that as well
 The standard of the pitches in the Premier League is normally very good, I have to say
"But it's the same for everybody
 Liverpool had to play here last week, I'm sure it's the same as it was today
"Brentford manager Thomas Frank could not hide his frustration after suffering another early domestic cup competition early
Their FA Cup exit comes two months after they exited the Carabao Cup third round at home to League Two basement club Gillingham on penalties
But in this game, Frank believed his side more than deserved to progress to round four
"I'm not devastated, I'm irritated
 Argh!" he said
 "I felt we did more than enough to win a tight game
 I know we're facing West Ham, they are a good side
 You're not just walking over a team who is much bigger than us
"We did everything we could, if you look at all the stats, there should have been a winner and it's us
 It's not our day
 There was one moment we should have avoided
"next game is at home to Bournemouth in the Premier League on Saturday, live on  - kick-off 5
30pm
The Bees then travel to for another top-flight fixture on Sunday January 22, live on  - kick-off 2pm
 next outing is a crucial Premier League game at fellow strugglers on Saturday - kick-off 3pm
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>