Cody McDonald hit a 92nd-minute winner as Gillingham beat Wolves 1-0 at Priestfield in League One on Friday night.