Both sides had chances in the opening half-hour, but it was the visitors who broke the deadlock as Ryan Jarvis slotted the ball in from close range in the 35th minute.
© Getty Images
Rovers got back on level terms again just before the hour mark through substitute Matt Harrold, who found the back of the net with his first touch less than a minute after coming off the bench.
The home side took the lead for the first time with 15 minutes to play, as Chris Beardsley headed in from deep inside the penalty area.
There was a late twist though, as Wes Fletcher was able to smash the ball in from point-blank range four minutes from full time, ensuring that the tie will be replayed at Bootham Crescent later this month.