Sebastian Larsson scored in injury time to snatch victory for Birmingham in Alex McLeish's first game as boss after Robbie Keane scored twice and saw red.
Gary McSheffrey put the Blues ahead from the spot against the run of play after Younes Kaboul brought him down.
Keane scored first with a penalty after Dimitar Berbatov was felled and got a second from a Tom Huddlestone pass.
But Cameron Jerome levelled and Keane was sent off for a late foul on Fabrice Muamba before Larsson's superb winner.
It was a classic Premier League encounter, the type which persuaded McLeish to leave his role as Scotland boss.
And while he will have been pleased with the doggedness of his new team in ending Tottenham's six-match unbeaten run under their new manager Juande Ramos, the Scotsman will want to work on a defence which was undone time and again.
Keane prodded and prompted just behind Berbatov and Darren Bent, while Gareth Bale and Aaron Lennon were menacing down the flanks.
And Keane should have scored when a delightful one-two with Bent left him with only the keeper to beat, but he blazed well over.
Berbatov then turned provider with an exquisite pass which slipped Bent through on goal, only for Maik Taylor to deflect his shot to safety.
Having survived a battering, Birmingham stunned the home fans when McSheffrey broke into the left side of the box, went down under a clumsy challenge from Kaboul and got up to convert the spot-kick.
The play continued to go largely in one direction, however, and it needed a terrific save from Taylor to maintain the visitors' advantage when Bale curled his free-kick over the wall towards the top left-hand corner of the goal.
Despite Spurs' superiority, Ramos had seen enough and replaced Kaboul and Bent with Huddlestone and Jermain Defoe, opting for the 3-4-3 formation he had used to spark Thursday's revival against Aalborg in the Uefa Cup.
It was very much a case of deja vu as Keane dispatched his spot-kick high into the left corner after Berbatov went to ground.
And only three minutes later, the Irishman finished first time from Huddlestone's pass over the defence to take his season's tally to 12 goals.
It should have been 3-1 when Bale's trickery down the left prompted a terrible clearance from Rafael Schmitz that landed at Berbatov's feet, but his effort crashed back off the foot of the post.
Somehow, Birmingham dragged themselves back into the game when Jerome forced his way through and fired past Paul Robinson from the edge of the area.
But chances continued to come for Spurs, and Berbatov in particular, as he found himself in plenty of space following a corner but his header was cleared by Schmitz a yard in front of the line.
The visitors needed some breathing space and were given it when Keane was shown a straight red by Phil Dowd, after consulting the fourth official, for a tackle on Muamba that was late but did not appear to be malicious.
Even with 10 men, Tottenham still took the initiative and Defoe came desperately close when the ball landed at his feet after yet another mix-up in the Birmingham defence.
Inevitably, there had to be a lull following some frenetic passages of play but the game ended with more action - this time in the home team's goalmouth.
Olivier Kapo's driven cross was met by fellow substitute Mikael Forssell and his effort thundered against the top of the bar before Robinson expertly denied Kapo.
But Larsson - who was previously at Arsenal - had the last word, cutting inside from the left and smashing a spectacular 25-yard shot into the top-right corner to end a breathless duel and seal Birmingham's first away league win since August.
Tottenham assistant boss Gus Poyet: "We created enough chances to win the game but unfortunately we didn't score early doors, we gave the penalty away and again had to make a big effort to come back. "We were looking to go on and win the game, and the attitude of the players and ability to score was there. If we had scored six or seven no-one would have been surprised.
"But we have to kill the game when we have chances and we have to work on the defending a bit."