Simeon Jackson gave the hosts a slender lead at the break but Adam Le Fondre's delicate lob just after the hour mark ensured Dale's unbeaten run in all competitions was extended to 13 games.
There was little to choose between the sides early on, but Gills took the lead with a flowing move on 17 minutes. Curtis Weston sprayed the ball out to Albert Jarrett on the left flank and the winger curled a great ball in for an unmarked Jackson to bury his eighth goal of the season from six yards.
Goal number nine should have arrived for the 21-year-old minutes later, but he shot straight at goalkeeper Sam Russell when clear.
Dale's unbeaten run looked under threat, but the visitors rallied just before half-time. Their best chance came from a corner in the final minute. The ball fell loose to Clark Keltie eight yards out, but the midfielder's powerful shot was straight at Simon Royce, who parried.
The visitors still had the momentum when play resumed and on 61 minutes they were deservedly level. Le Fondre received the ball on the edge of the box and carved out half-a-yard of space for himself to lob a stranded Royce for his fifth goal in three games.
The game could have gone either way and refreshingly both managers opted to go all out for the victory, throwing forwards on from the bench. The result was a frenetic last 20 minutes, but surprisingly little in the way of clear chances.
Leigh Mills came closest to finding a winner, but his header was cleared off the line by Lee Thorpe five minutes from time.