The visitors were hoping to stay ahead of nearest challengers Sunderland at the top while Fleetwood are still looking over their shoulders at the relegation battle.
And substitute Pilkington pounced in the fifth of six added minutes to frustrate their visitors, who were leapfrogged by both the Black Cats and Wycombe as a result.
Fleetwood should have taken a second-minute lead through Callum Camps but Josh Vickers pulled off a good save when left exposed by his defence.
The Millers' Will Grigg somehow put one close-range finish wide of the near post after good work from Chiedozie Ogbene, and moments later headed another chance against the bar.
Ogbene could also have given the table-toppers the lead but a good reaction save by keeper Alex Cairns denied him.
Fleetwood's new signing Ellis Harrison nearly hit his second in two games for them with a header, but Vickers pushed the ball onto the bar and over.
Half-time substitute Joshua Kayode nearly made an immediate impact but he glanced Dan Barlaser's corner narrowly wide.
The chances dried up after that but with time running out, Pilkington beat Vickers to debutant Toto Nsiala's header and forced it in to spark wild celebrations.
Poor behaviour from some fans capped off a crap day.