It seemed Spurs had done enough to book their place in the quarter-finals when in-form England striker Harry Kane, on as a substitute, scored from the penalty spot with two minutes of normal time remaining to make it 2-1 to the visitors.
But Rochdale, who had opened the scoring on the stroke of half-time through Ian Henderson, equalised when substitute Steve Davies scored from 12 yards in the third minute of stoppage time.
This result means Rochdale, bottom of third-tier League One, can now look forward to a lucrative replay at Wembley -- London club Tottenham's temporary home while their successor ground to White Hart Lane is completed.
"They say it's every kid's dream (to play at Wembley) and we have done enough to go there," Davies told the BBC, before saying of his equaliser: "I've done my job, it's dropped to me and I've finished it."
Rochdale went ahead when Henderson crowned a slick move that made a mockery of the club's league position with a composed finish after an excellent angled through-ball from Andrew Cannon split Spurs' defence.
Lucas Moura, however, drew Spurs level, exchanging passes with Moussa Sissoko and beating Rochdale keeper John Lillis just shy of the hour-mark.
It seemed Spurs' recovery was complete when Rochdale defender Harrison McGahey brought down Dele Alli and Kane beat Lillis, who dived the right way, with a well-struck penalty.
But there was still time for one more twist which means Spurs are facing a Wembley replay for the second round in a row, having needed two games to end fourth-tier strugglers Newport County's FA Cup run.
"It's unbelievable," said Henderson. "We played some incredible football against Spurs. We cannot wait to go to Wembley to play them. I knew that we would always have an opportunity (to equalise)."
- 'FA Cup magic'
Rochdale manager Keith Hill added: "We had to do it our way and we did. The players will be looking forward to it (a replay at Wembley) as well as the supporters."
His Spurs counterpart, Mauricio Pochettino, tried to play down the inconvenience of an unscheduled extra game for his side, still involved in the Champions League and in the hunt for a top-four finish in the Premier League.
"The FA Cup is magic," said Pochettino, the Tottenham manager giving voice to one of English football's best-loved, but in this case apt, cliches.
"We have another opportunity at Wembley, the same situation like before," the Argentinian added.
Pochettino insisted he did not believe the prolific Kane's goal had settled the tie in favour of eight-times FA Cup winners Tottenham.
"No - I was so calm on the bench because I know very well what happens if you believe the tie is over. That happens. We concede two clear chances, one was nearly and one was a goal."
Pochettino paid tribute to Rochdale, saying the way they had raised their game for the FA Cup was no shock in his eyes. "I was not surprised," he said. "This competition is completely different. Newport gave us a fantastic game and they lost their next game in the league 5-0.
"The motivation is always massive. It's not easy to play this type of game. Of course we wanted to win but we have the possibility to win (the tie in a replay)."