Rochdale were without top scorer Grant Holt and had to play a 4-5-1 formation with Paul Tait the only striker. But they stuck to their game plan well and shook Yeovil with an eighth minute goal.
Alan Goodall gave Scott Guyett the slip and fired neatly past Chris Weale. Yeovil were out-numbered in midfield but still managed to mount some dangerous attacks and both Guyett and Bartosz Tarachulski hit the woodwork before the break.
In the second half Yeovil came out with a fresh head of steam with more bodies in midfield. The equaliser had to come and it did in the 62nd minute although not before the crossbar had come to Rochdale's rescue once again, this time from a Paul Terry header.
Yeovil brought on Arron Davies at half time and it was he who provided the cross for a far post header from Tarachulski to level in the 62nd minute.
Yeovil probably thought they would go on to win comfortably but their defence was caught shot at the back in the 78th min and the lively Leo Bertos nipped on to a pass from Wayne Evans to score.
Just six minutes from time, Yeovil were awarded a penalty when Davies was brought down by Gareth Griffiths and with 100 per cent spot-kick man Phil Jevons having been substituted it was left to manager's son Lee Johnson to save the day.