Frank Nouble opened the scoring just after half-time, and as Dale went in search of the equaliser the home side finished off the game.
Jay Emmanuel-Thomas and Mark Byrne scored two late goals to seal the win for the home side.
There was one changed to the side that started against Walsall on Tuesday, as Joe Bunney returned from suspension to replace Reuben Noble-Lazarus who was named on the bench.
Bunney had the first effort of the match after being played in by Nathaniel Mendez-Laing, but his curling effort from the edge of the area went wide of the upright.
Rafferty saw a speculative effort from 40-yards rise over the bar, before Mendez-Laing had a shot held by Stuart Nelson. He had made a great run into the box, skipping past a couple of Gills players, but his low effort was straight at the ‘keeper.
Dale were enjoying the majority of the possession and the Gills’ first shot on goal didn’t come until the 25th minute. As Cody McDonald attempted to stride forward into the area, out-stepped Jim McNulty with a timely block to dispossess him. The ball fell kindly for Emmanuel-Thomas, who struck well wide of the target.
Shortly after the half hour, Ollie Rathbone, who scored his first senior goal in Tuesday night’s win over Walsall, picked up on a loose ball on the edge of the area but could only curl his effort wide of the post.
The Gills had the ball in the back of the net soon after, but Baily Cargill’s stooping header at the back post from a Bradley Dack set-piece delivery was ruled out for offside.
Before the half was out, Rafferty had a dipping effort from distance held by Nelson.
HT: GILLINGHAM 0-0 ROCHDALE
After the re-start, the Gills’ Nouble delivered across the face of goal, but there was no-one there to attack the ball and Dale saw away the danger.
In the 51st minute, Manager Keith Hill made a double substitution, introducing Ian Henderson and Steven Davies into the action. Rathbone and Bunney made way for them.
Three minutes later, the home side opened the scoring. From a quick throw in, Nouble got a shot away and his effort was deflected into the back of the net by Davies who could do nothing about.
Soon after, Logan pulled off a finger-tip save to turn a Cargill header round the upright. From the resulting corner, Davies defended away a goal-bound Nouble effort on the line.
Davies had a strike kept out by Nelson, before Mendez-Laing made way for Sanmi Odelusi as Dale began to ramp up the pressure.
Rochdale were asking all of the questions as they went in search of an equaliser and they went close on two occasions in quick succession. Lund was firstly denied on the line, before Rafferty saw an effort deflected behind for a corner.
A few minutes later, goalkeeper Nelson punched away a Dale delivery as far as Lund, who struck just inches wide of the upright.
Dale were pushing forward in search of the equaliser, but as they did so the game became more open for the home side, and they were clinical enough to seal the game in the closing minutes.
Emmanuel-Thomas showed a superb touch and turn on the right side and he calmly finished past Logan to make it 2-0.
Mark Byrne scored a third goal in added time. Fellow substitute Rory Donnelly did well to prod a fine ball across goal where the run of Byrne was perfectly timed, allowing him to finish past Logan.
The score-line didn’t reflect the game and it was harsh on Dale, with the result flattering the home side.