Fleetwood dealt a blow to promotion-chasing rivals Rochdale as Mark Roberts' 83rd-minute header clinched a 2-1 win at Spotland.
After a chanceless opening 20 minutes, the visitors edged ahead when referee Richard Clark awarded a spot-kick for a foul on Charles Taylor by Rhys Bennett.
Antoni Sarcevic fired home a hard, low drive from the penalty spot, beating Josh Lillis despite the goalkeeper guessing the right way.
The home side were level in the 40th minute, though, as Ian Henderson's corner from the left was headed goalward by Ashley Eastham and Scott Hogan reacted sharply, flicking the ball into the net from close range.
Nathan Tyson wasted a good opportunity just before the break when, unmarked at the back post, he headed Taylor's cross high and wide.
Fleetwood went even closer in the 48th minute when Gareth Evans found Sarcevic at the back post with just Lillis to beat, but he drilled a first-time effort against the upright and Dale were off the hook.
But when Junior Brown's free-kick seven minutes from time was headed against the post by Nathan Pond, Roberts was there to capitalise, stooping low to head the ball across the line.