The Gills came from behind to extend their superb away record, having now not lost on their travels since October, with goalscorer Bradley Dack and half-time substitute Charlie Allen earning particular praise.
Gillingham's lead at the top of the table was cut from five to four points but they still boast a game in hand over their rivals, who now have just seven matches to close the gap.
After seeing Dack level the scores with his first-ever Football League goal, Allen said: "Bradley has been on the radar for a long time. He scored 27 goals in the youth team last year and five goals for us in pre-season and I think I perhaps should have used him more this season.
"Having said that I was going to rest him here because I wondered if three games in a week was going to be too much. But he scored some great goals in training on Friday and looked really sharp and that made my mind up.
"He has a great engine, really looks after himself and gets into great positions and I thought he and Charlie Allen were excellent for us.
"The pace and running ability they have is priceless and their power told in the second half, I think if anyone deserved to win it was us. They had a lot of the ball but didn't really hurt us."
Morecambe boss Jim Bentley was frustrated that his side had failed to win a game for the third time in a week having taken the lead, Jack Redshaw scoring his fifth goal in six games.
He said: "It's disappointing that we haven't managed to win a game after taking the lead in three games. When you go into the break in the lead and playing well, it is all the more disappointing when you surrender the lead in the manner we did.
"But I have to give credit where it is due. They (Gillingham) are a top side and played some good stuff despite a poor pitch. But we have shown that we can match the best teams in the league when we are at our best and have now lost just once in six months at home, which is really promising for us."