John Mousinho scored to earn Gillingham victory over his former club Stevenage in an entertaining game at Priestfield.
Simon Heslop's 20-yard drive had given the visitors a half-time lead.
Danny Kedwell levelled the match shortly after the break, scoring from the spot following Jon Ashton's foul, and Donervon Daniels fired home on his debut to put the home side in front.
Francois Zoko's flick then levelled the game once more, before Mousinho's header won it for Gillingham.
The victory moves Peter Taylor's side up to 16th in League One, while Stevenage, who have now lost three of their last four, are 19th.
VIEW FROM THE DRESSING ROOM
Stevenage manager Graham Westley told BBC Three Counties Radio:
"I thought it was going pretty badly wrong in the first half, I think we were fortunate to be ahead.
"Off the back of a really good win with 10 men, we've put virtually the same team out and they've looked tired.
"We've got to bounce back from this performance like we did the Rotherham one.
[On the second Gillingham goal] "It is really difficult to understand how a player can't be interfering with play when he's obstructing the goalkeeper's ability to work across his line."
Gillingham 01 Nelson 23 Harriman 03 Martin 32 Mousinho 28 Daniels 26 Barrett 29 Hewitt 19 Hollands 11 Weston 09 Kedwell 27 Fagan (McDonald - 77' ) Substitutes 05 Davies 07 Whelpdale 08 Akinfenwa 10 McDonald 15 Dack 21 Howard 31 Hessenthaler Stevenage 16 Day 22 Gray (Andrade - 80' ) 29 Hartley Booked (Deacon - 86' ) 24 Doughty 05 Ashton 06 Jones 15 Freeman 14 Heslop 12 Zoko 11 Akins 07 Morais (Burrow - 82' ) Substitutes 01 Arnold 02 Wedgbury 10 Burrow 17 Tansey 21 Tounkara 25 Andrade 34 Deacon
Ref: Brendan Malone