Keith Hill's play-off chasers looked set for another home win until Twiss popped up in the 91st minute to beat Frank Fielding to a loose ball and hammer home Wayne Curtis' flick.
Rochdale controlled the game for long periods and looked set to be heading for the three points after Will Buckley had put them ahead with a neat goal four minutes into the second half.
Buckley took the ball on the left-hand side and was given time and space to pick his spot with a curling shot into the bottom left-hand corner.
Rochdale, who almost opened the scoring on 41 minutes when Chris Dagnall hit the post after a neat run and shot, came close to sealing the game in the final stages.
On 80 minutes substitute Lee Thorpe thought he had slotted home Nicky Adams' left-wing cross but Barry Roche produced a superb save.
One minute later Roche was the Shrimps' hero again with another stunning save to tip away a Nicky Adams curler.
But from there the home side sat back and Morecambe took full advantage.
The Shrimps' former Rochdale striker Rene Howe looked set to get on to the end of a Neil Wainwright cross but lost his balance as he prepared to head past Fielding before Twiss' last-gasp strike.
Rochdale started brightly with Scott Wiseman drilling a shot inches wide after a storming run in the first minute of the game.
Six minutes later midfielder Gary Jones volleyed over at the far post following an Adams corner.
Morecambe hit back with a Twiss cross being deflected just over his own goal by Wiseman with keeper Fielding stranded.
A minute later Garry Hunter rifled a low ball across the six-yard box with Dave Artell inches away from converting.
But it was Rochdale who came closest to opening the scoring when, on 41 minutes, Dagnall ran into the box and drilled in a low shot that beat Roche but came back off the foot of the post.