Needing just a draw to progress, Emmanuel Adebayor put Tottenham ahead just before the half hour, but the Greeks, who have never won in Britain, played the better football and deservedly equalised through Zeca just after the re-start.
Panathinaikos, knowing victory was their only means of qualifying for the knockout stages, threw everything at Tottenham but Clint Dempsey - whose header went in after hitting both the bar and keeper Orestis Karnezis - and Jermain Defoe's 13th goal of the season settled the game late on.
Lazio's drubbing of Maribor means Andre Villas-Boas' men qualify second from Group J. Panathinaikos had only beaten an English team once in their history, but they looked the more likely to break the deadlock in the first 15 minutes.
Jose Toche sprinted on to an Ibrahim Sissoko through-ball, but he mis-controlled the pass and Brad Friedel gathered easily. The Spaniard then slipped his marker to meet Giourkas Seitaridis' cross, but he could only shoot weakly at the Spurs stopper.
All of a sudden Adebayor put the hosts ahead as he spun off his marker to collect Dempsey's through ball and slot the ball past Karnezis. Panathinaikos came back at the Londoners through Toche, who beat the offside trap but Friedel raced off his line to claw the ball away.
Tottenham came out a bit brighter in the second half as Dempsey fed Defoe with a clever pass, but the England striker's shot struck the foot of a post before bouncing to safety. Panathinaikos then struck a 54th-minute equaliser as Zeca met Nikos Spyropoulos' cross to beat Friedel with a clinical header.
Kyle Naughton's frustration got the better of him as he put in a rugby-style ankle tap on Sissoko to earn a booking. Tottenham failed to clear a routine Panathinaikos cross and the ball fell to Toche, but he shot wide while Jan Vertonghen put in a crucial header to clear Spryopoulos' wicked corner as the Greeks continued to pile on the pressure.
Dempsey then settled the home fans' nerves with Tottenham's second. Sandro earned a free-kick 25 yards out which Kyle Walker swung in deep and the former Fulham forward headed onto the bar before it bounced in off the keeper.
It proved to be Dempsey's last contribution to the game as he came off for Gylfi Sigurdsson and any hopes of an unlikely Panathinaikos comeback were dashed with seven minutes left when Defoe latched on to Aaron Lennon's pass and chipped the ball over Karnezis.