The Millers dominated the first half but grim determination kept them at bay.
But the dam finally broke 10 minutes after the break. Kieran Agard had already hit a post and on his next foray forward the striker's shot was blocked by Mark Roberts and Nouha Dicko, following in at the back post, fired Rotherham level.
The goal injected fresh life into Fleetwood, with Antoni Sarcevic nearly forcing a way through.
There was late drama as first Lee Frecklington and then James Tavernier forced added-time saves from Scott Davies as Fleetwood held on.