Gillingham manager Andy Hessenthaler put points above the performance as he side saw off Accrington 3-1 to move up into sixth place in League Two.
Andy Barcham opened the scoring before Phil Edwards crucially missed from the penalty spot for the visitors.
Stanley did level minutes later through Sean McConville, only for Barcham to cleverly dink a second on the stroke of half-time. Gills upped the ante after the restart and it was left for Cody McDonald to head home a third.
Hessenthaler said: "It's all about getting three points at the end of the day, sometimes you have to win ugly. We have only lost two in 21 games and that's a fantastic record.
"Their midfield took risks during the game; we changed our shape and in the second half looked very comfortable.
"I thought we stifled them, the second half wasn't as even as the first half but we did look very comfortable. We were very fortunate to go in 2-1 at half-time but we had a few home truths at half-time, and I thought the second half we were much better but the first half was not acceptable."