The Robins welcomed Martin Allen’s winless Gills to the County Ground, with both sides at the wrong end of the League One table.
In what was a scrappy game, both sides could have scored four, had their finishing been more clinical.
The home side went ahead on the 12th minute through ex-Tottenham man Nathan Byrne, who bundled home full-back Nathan Thompson’s drilled cross.
The Gills didn’t buckle though and were back level moments later through route one football as Danny Kedwell powered home a header from Chris Whelpdale’s long throw.
The Robins were struggling to deal with the visitors’ physical threat, but could have regained the lead through Darren Ward if Stuart Nelson hadn’t pushed his header onto the post.
Swindon did take the lead midway through the second half when Thompson got a goal to go with his assist when he headed home Ryan Harley’s cross on the 68th minute.
But fighting Gillingham hit back late on when McDonald beat the last man and slotted past keeper Wes Foderingham.