Two goals in stoppage time produced a dramatic late turnaround at Goodison Park as Everton beat Tottenham to move into fourth spot in the Premier League.
Spurs appeared to be on their way to victory courtesy of Clint Dempsey's deflected 76th-minute strike.
Gylfi Sigurdsson then hit the Toffees crossbar with a shot before Steven Pienaar header in against his former club to equalise after 90 minutes.
Moyes happy with Everton 'character'
Nikica Jelavic then turned in a close-range shot for Everton's winner.
Spurs, without the buccaneering Gareth Bale through injury, thought they had produced a classic away performance, having soaked up the home side's pressure before taking the lead through one of their rare forays forward.
But Everton had a sting in their tail and extended their unbeaten run at Goodison Park to 12 games with a late rally which saw them leapfrog their opponents into the Champions League places on goal difference.
Toffees manager David Moyes was favourite to take over at Tottenham at one point during the summer prior to Andre Villas-Boas entering the fray and taking over as boss of the White Hart Lane outfit.
The pair shared a hug before the game but, if Moyes had any point to make to the London club's hierarchy, his side certainly began with the intent and industry to try to make it for him.
Steve BowerBBC Match of the Day commentator
"David Moyes's Everton take all three points and go above Spurs and into the top four after a late turnaround. Andre-Villas Boas's team took the lead and then two dramatic late goals have won it for Everton."
Home midfielder Leon Osman had an early shot blocked after Pienaar, who returned to Goodison Park last January after a move to Spurs did not work out, cushioned a header into his path.
The visitors settled but, although Everton were looking the most dangerous, a combination of last-ditch defending, a smart save from keeper Hugo Lloris and lack of cutting edge in the final third held the home side at bay.
Lloris quickly came out of his goal to palm the ball away from the feet of Jelavic when the striker was put through on goal.
Spurs defender William Gallas also crucially intercepted a Kevin Mirallas cross in front of a waiting Jelavic, while Seamus Coleman sent an angled effort into the side-netting before Osman sent a shot across goal.
Everton also had two handball shouts against Dempsey and Gallas but neither were conclusive enough for referee Kevin Friend to award a penalty.
Spurs usually have a stylish swagger to their play but they were showing they could also put in a workmanlike performance as they frustrated their hosts.
Tottenham would be top of the Premier League if all the games had ended after 80 minutes. Spurs would have 34 points and be two points ahead of Manchester United and five ahead of Manchester City.
Toffees midfielder Steven Naismith came on after the break and he immediately had a chance. Leighton Baines fired in a shot at goal after his free-kick had come back off the Tottenham wall but Naismith side-footed the off-target effort wide from eight yards.
Everton were punished for not making the most of their possession when Dempsey's long range shot went in via a deflection off centre-back Sylvain Distin.
It was a body blow for the home side but, after Spurs substitute Sigurdsson's shot hit the crossbar, the home side showed the character and spirit they are renowned for when Pienaar powered a ferocious header in from a Seamus Coleman cross.
Spurs barely had time to reflect on the equaliser before Apostolos Vellios's overhead kick fell for Jelavic to score the winner from eight yards, with Moyes coming on to the pitch in celebration.
Everton manager David Moyes:
"It is as good a finish as we've had. We've had a few like that where we've lost and felt low so we were due one.
Villas-Boas commends Spurs effort
"The position [fourth place] doesn't shame the way the players have been playing, they have been doing that well.
"But we could quite easily have slipped out and been in the bottom half of the league. It feels good today but we have to make sure we maintain that."
Tottenham boss Andre Villas-Boas:
"It was a disappointing result bearing in mind we were leading taking the game into the last minute.
"It has been quite an adventure in the Premier League this season; if we count the number of results that have been going for us before the last minutes we would be first.
"There are so many different reasons. It is not really easy to explain because a couple of them come from different situations.
"It is something we are aware of, which is why we speak about it openly, and it is something we have to improve, seeing off games."
90:00+5:19 The referee blows for the end of the match.
90:00+3:02 Booking The referee cautions Nikica Jelavic for unsporting behaviour.
90:00+2:56 Direct free kick taken by Sylvain Distin.
90:00+2:56 Substitution Johnny Heitinga comes on in place of Nikica Jelavic.
90:00+2:56 Free kick awarded for a foul by Tom Huddlestone on Nikica Jelavic.
90:00+1:23 Apostolos Vellios has an effort at goal.
90:00+1:22 Assist on the goal came from Apostolos Vellios.
90:00+1:22 GOAL - Nikica Jelavic:Everton 2 - 1 Tottenham Nikica Jelavic finds the back of the net with a goal from inside the area to the bottom left corner of the goal. Everton 2-1
89:54 The assist for the goal came from Seamus Coleman.
89:54 GOAL - Steven Pienaar:Everton 1 - 1 Tottenham Steven Pienaar scores a headed goal from inside the penalty area. Everton 1-1 Tottenham.
86:45 The ball is delivered by Jan Vertonghen, comfortable save by Tim Howard.
84:34 Substitution Yago Falque on for Jermain Defoe.
84:19 Gylfi Sigurdsson produces a curled right-footed shot from 20 yards.
80:34 Substitution Apostolos Vellios is brought on as a substitute for Leon Osman.
76:05 Substitution Gylfi Sigurdsson joins the action as a substitute, replacing Mousa Dembele.
75:04 Tom Huddlestone provided the assist for the goal.
75:04 GOAL - Clint Dempsey:Everton 0 - 1 Tottenham Clint Dempsey finds the net with a goal from long range to the bottom right corner of the goal. Everton 0-1 Tottenham.
74:47 Free kick awarded for a foul by Steven Pienaar on Mousa Dembele. Free kick taken by Raniere Sandro.
73:40 Leon Osman has a drilled shot. Save by Hugo Lloris.
72:31 Marouane Fellaini has a drilled shot. Blocked by Leon Osman.
69:17 The free kick is delivered right-footed by Kyle Walker from right wing.
69:17 Booking The referee books Leon Osman for unsporting behaviour.
69:13 Leon Osman concedes a free kick for a foul on Kyle Walker.
66:34 Emmanuel Adebayor concedes a free kick for a foul on Phil Jagielka. Darron Gibson takes the free kick.
65:58 Shot on goal by Leon Osman from just inside the area goes over the target.
65:47 The ball is swung over by Seamus Coleman, save made by Hugo Lloris.
64:07 Centre by Jan Vertonghen, clearance by Phil Jagielka.
63:23 Steven Naismith challenges Clint Dempsey unfairly and gives away a free kick. Kyle Walker takes the direct free kick.
61:49 Marouane Fellaini takes a shot. Save by Hugo Lloris.
61:26 Foul by Emmanuel Adebayor on Seamus Coleman, free kick awarded. Direct free kick taken by Darron Gibson.
55:50 Centre by Aaron Lennon, blocked by Leighton Baines.
55:19 Corner taken right-footed by Kyle Walker to the near post, Nikica Jelavic manages to make a clearance.
53:55 Free kick awarded for an unfair challenge on Clint Dempsey by Darron Gibson. Aaron Lennon takes the direct free kick. Drilled
left-footed shot by Jan Vertonghen. Save made by Tim Howard.
51:47 William Gallas has an effort at goal. Steven Naismith gets a block in. Inswinging corner taken from the left by-line by Kyle
51:22 Inswinging corner taken by Kyle Walker, clearance by Darron Gibson.
51:03 Raniere Sandro takes a shot. Blocked by Sylvain Distin.
50:13 Unfair challenge on Mousa Dembele by Marouane Fellaini results in a free kick. William Gallas restarts play with the free
48:10 Nikica Jelavic takes a shot. Blocked by William Gallas.
45:59 Free kick awarded for an unfair challenge on Leon Osman by Raniere Sandro. Leighton Baines produces a shot on goal direct
from the free kick. Close range shot by Steven Naismith goes wide of the right-hand upright.
Correction - 45:01 Substitution Steven Naismith comes on in place of Kevin Mirallas.
45:01 The referee starts the second half.
45:01 Substitution Steven Naismith comes on in place of Kevin Mirallas.
44:52 Leon Osman takes a shot. Hugo Lloris makes a save. Corner taken by Leighton Baines.
Correction - 44:22 Kevin Mirallas takes a shot. Kyle Walker gets a block in.
44:22 Kevin Mirallas takes a shot. Blocked by Steven Caulker.
42:49 Free kick awarded for an unfair challenge on Steven Pienaar by Raniere Sandro. Leon Osman restarts play with the free kick.
Correction - 41:38 Kyle Walker restarts play with the free kick.
41:38 Raniere Sandro takes the free kick.
41:38 Booking Leighton Baines is given a yellow card.
41:29 Leighton Baines challenges Aaron Lennon unfairly and gives away a free kick.
38:38 A cross is delivered by Leon Osman.
36:36 The free kick is delivered right-footed by Darron Gibson from right wing, Steven Caulker manages to make a clearance.
36:36 Booking Caution for Jan Vertonghen.
36:06 Jan Vertonghen challenges Seamus Coleman unfairly and gives away a free kick.
35:07 Unfair challenge on Leon Osman by Raniere Sandro results in a free kick. Leon Osman restarts play with the free kick.
34:09 Free kick crossed left-footed by Leighton Baines, William Gallas manages to make a clearance.
34:09 Booking Jermain Defoe receives a caution.
33:23 Raniere Sandro challenges Marouane Fellaini unfairly and gives away a free kick.
32:07 Seamus Coleman sends in a cross, clearance made by Raniere Sandro.
30:58 Kevin Mirallas produces a drilled right-footed shot from 25 yards. William Gallas gets a block in.
28:23 Outswinging corner taken right-footed by Steven Pienaar from the right by-line to the near post, Header from deep inside the
penalty area by Marouane Fellaini goes harmlessly over the crossbar.
26:37 Free kick awarded for a foul by Nikica Jelavic on Mousa Dembele. Jan Vertonghen restarts play with the free kick.
25:41 Steven Pienaar has an effort at goal from outside the penalty box missing to the wide left of the goal.
24:32 Unfair challenge on Raniere Sandro by Leon Osman results in a free kick. Steven Caulker takes the direct free kick.
20:28 A cross is delivered by Kyle Walker, Darron Gibson makes a clearance.
20:02 Outswinging corner taken right-footed by Kyle Walker, Darron Gibson makes a clearance.
19:34 Jermain Defoe has an effort at goal from 20 yards. Blocked by Leon Osman.
18:42 Darron Gibson produces a right-footed shot from long range which goes wide right of the goal.
17:51 Outswinging corner taken left-footed by Leighton Baines from the left by-line, Emmanuel Adebayor manages to make a clearance.
17:17 The referee blows for offside. Raniere Sandro takes the free kick.
14:04 Darron Gibson gives away a free kick for an unfair challenge on Clint Dempsey. Clint Dempsey has an effort direct from the
free kick, Tim Howard makes a comfortable save.
10:48 Seamus Coleman is penalised for handball and concedes a free kick. Hugo Lloris takes the free kick.
8:58 Free kick awarded for an unfair challenge on Mousa Dembele by Marouane Fellaini. Hugo Lloris takes the free kick.
8:23 Outswinging corner taken by Kevin Mirallas from the right by-line.
7:11 Kyle Walker delivers the ball, clearance made by Sylvain Distin. Mousa Dembele produces a drilled left-footed shot from 25
yards. Save by Tim Howard.
7:04 The ball is crossed by Jan Vertonghen, clearance by Phil Jagielka.
5:33 Handball decision goes against Darron Gibson. Direct free kick taken by Clint Dempsey.
Correction - 1:09 Leon Osman takes a shot. Blocked by William Gallas.
1:09 Leon Osman takes a shot. Steven Caulker gets a block in.
0:46 Unfair challenge on Nikica Jelavic by Raniere Sandro results in a free kick. Leon Osman takes the free kick.
0:00 The ref blows the whistle to start the match.
Live text and data provided by The Press Association.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.