Substitute Dan Gosling put Everton into the fifth round of the FA Cup with a 118th-minute winner against 10-man Liverpool in their replay at Goodison Park.

The 18-year-old fired home off a post from Andy van der Meyde's right-wing cross to snatch victory from a fiery derby encounter which looked destined for penalties.

Liverpool had Lucas sent off with 14 minutes remaining in normal time for a second bookable offence but the visitors could just not hold on for spot-kicks

Liverpool manager Rafael Benitez made two changes to the side which beat Chelsea on Sunday, bringing in Lucas Leiva for Javier Mascherano and Andrea Dossena for Fabio Aurelio.

Following the sale of Robbie Keane back to Tottenham on transfer deadline day, the only player on the bench capable of filling the centre-forward role was Ryan Babel, whose Liverpool career so far has seen him play purely a left-winger.

In the sixth minute Xabi Alonso found Fernando Torres wide on the right but Joleon Lescott got over to block at the expense of a corner. Steven Gerrard took the corner kick but his cross was cleared.

The ball eventually broke to Alonso who smashed a low shot just wide of goalkeeper Tim Howard's right-hand post from 30 yards.

Albert Riera's effort from a similar distance from the other side was, however, much further off target.

As in their previous two meetings - this was the third match in a fortnight and fourth of the season - Liverpool dominated possession early on.

For once Torres' control deserted him when Lescott missed Alvaro Arbeloa's cross into the penalty area and the ball bounced harmlessly away.

The visitors suffered a huge blow in the 16th minute when Gerrard was forced off with a hamstring injury, forcing Benitez to replace him with Yossi Benayoun.

With Liverpool still challenging for the league title it may have been a precautionary measure but it deprived Liverpool of their main attacking threat.

The derby began to heat up in the 19th minute as Everton's makeshift striker Tim Cahill was booked after leading with his forearm into the face of Jamie Carragher.

Riera, Torres and Dirk Kuyt were then spoken to by referee Alan Wiley for over-physical challenges as the hosts sensed their chance to exploit their opponents' perceived weakness.

Everton, visibly lifted by Gerrard's departure, had their first shot in the 25th minute when Leon Osman volleyed over from Cahill's knock-down.

Cahill then missed his kick with an attempted shot on the turn on the edge of the six-yard area, but the defence only half-cleared and Everton were able to keep the pressure on with a Mikel Arteta free-kick and subsequent corner.

The match had completely turned around after Gerrard's substitution with Liverpool looking much less composed without their captain.

Kuyt was asked to play the role behind Torres and despite a similar work-rate he lacked Gerrard's vision and ability to drive the side forward.

With 10 minutes still to go in the first half the game had already become a ragged end-to-end affair with Everton opening up more than they had in previous matches as they sought to take advantage.

Just before the interval Steven Pienaar was booked for a tackle on Lucas as the hostility between the two sides went up another notch.

The animosity had obviously not dissipated during the interval as the first action of the second half was a booking for Phil Neville for going in late on Alonso in the 48th minute.

Lucas's name went into the referee's notebook moments later after he clattered into Arteta.

Marouane Fellaini, who had been unusually quiet, was replaced by Dan Gosling in the 52nd minute.

Kuyt and Benayoun were taking it in turns to play the supporting role behind Torres but neither was able to get a grip of the game in the way Gerrard so often does.

Tempers were also running high off the pitch and when Leighton Baines went to take a throw in front of the visiting fans a couple of bottles were thrown onto the pitch.

Moyes made his next move by sending on Jack Rodwell for Pienaar on the hour mark.

The first save of any real note in the entire match came shortly after when Alonso's through ball put Riera in the clear on the left of the area but Howard came out to block well.

Kuyt's looping header from Riera's 69th-minute cross was also comfortably held by Howard.

Osman should probably have put Everton ahead in the 71st minute when Arteta picked out Cahill and he laid off to the midfielder who drilled a shot against the outside of the post.

There was more trouble for Liverpool when Lucas was shown a second yellow card for tripping Lescott in the centre-circle with 14 minutes to go.

That prompted the immediate introduction of Javier Mascherano for Riera as the visitors hung on for extra time.

In the 98th minute Jose Reina made a good double save from Osman's shot and Cahill's follow-up and from the resulting corner the latter headed narrowly wide of the far post.

Two minutes later Babel replaced Torres, who had hardly had a kick all night due to the continued excellence of Phil Jagielka.

With penalties looking a certainty Dan Gosling snatched the winner with just two minutes remaining.

The 18-year-old fired in off a post, via a couple of deflections, from fellow substitute Andy van der Meyde's right-wing cross.