The Shrimps led 1-0 with four minutes to go after a first-half header from Sam Lavelle.
But two quickfire Dale goals from Fabio Tavares and Alex Newby saw the visitors take the victory in dramatic circumstances.
Morecambe boss Derek Adams made seven changes to the side that beat Grimsby in the Carabao Cup on Saturday and the Shrimps started the game on the front foot,
Jordan Slew looked dangerous down the left-hand side and fired an early effort wide before Ben Pringle, making his first start for the club, curled a left-foot effort just wide of the right-hand post from the edge of the box.
Liam McAlinden was the next to go close with a shot from the edge of the area that went wide of the left-hand post before Morecambe opened the scoring on 24 minutes.
Former PNE man Pringle produced a dangerous right-wing corner and Lavelle rose above his marker to head into the top corner of the Rochdale goal.
The home side then squandered two chances to go further ahead when Adam Phillips blazed over the bar from the edge of the box and John O’Sullivan headed wide from just six yards out when he had the goal at his mercy.
The misses gave the visitors some hope and they came back into the game and stretched the Shrimps defence, with Mark Halstead saving well from Lewis Bradley and then punching away a stinging free-kick from Oliver Rathbone.
After a period of Rochdale dominance the Shrimps then created – and wasted – a host of chances with Phillips seeing an effort well saved by former Fylde keeper Jay Lynch, and Harry Davis twice heading Pringle corners over from good openings.
The game changed on 86 minutes when Rochdale drew level from a well-taken free-kick. Aaron Motley played in Tavares with a ball down the middle and the young striker finished well on the turn.
Pringle and Carlos Mendes-Gomes then went close for the Shrimps before Rochdale took the points at the death when a left-wing cross caused problems and former Morecambe academy youngster Newby provided the final touch to turn the ball over the line from close range.
Morecambe: Halstead, Cooney, Lavelle, Knight-Percival (Davis 46), Conlan, Pringle, Kenyon, Phillips (Mendes-Gomes 61), O’Sullivan (Price 75), McAlinden, Slew. Subs not used: Turner, Stockton, Mellor, Hendrie.
Rochdale: Lynch, McLaughlin 9rep Keohane 46), Amankwah (Newby 72), McNulty, Dunne, Morley, Bradley, Brierley, Rathbone (Dooley 64), Tavares, Bath. Subs not used: O’Connel, Hopper, Wade.
Ref: S Barrott.