Gills boss Peter Taylor was delighted to put further distance between themselves and the League 1 relegation battle.
Victory over Carlisle United left the Gills nine points above the bottom four and in the top half of the table.
“It was a very important win,” said Taylor. “It was an important place to get a point or three. It’s fantastic that it’s three.
“Some of our football was good and our togetherness second half was excellent.”
The Gills took the lead through loanee Joe Pigott, with a cool finish under pressure.
“It was a very good finish from Joe and I thought some of his hold-up play was good as well,” said the Gills boss.
“I am delighted for him and I am sure he is pleased. He came to us on loan to get some good match experience and we know he is a good finisher. He showed everything that he is about in that game.”
The game looked to have been sewn up when Cody McDonald hit a second with two minutes left.
“He worked his socks off all afternoon and I like the way he took his goal,” Taylor said.
“He had to do a lot of chasing second half and he was fantastic.”
The Gills still ensured it was a nervy finish when Leon Legge directed an 89 minute cross into his own net.
Taylor said: “It was an early ball and I think maybe he could have changed his position if it hadn’t come over so early. He was running towards his own goal so what do you do? Do you leave it and it goes to someone or head it?
“To be fair to Legge he has headed most things all afternoon and he headed that one as well but unfortunately it went in our net.
“They put us under a lot of pressure and they were a threat but we had to handle it and in the end we restricted them to a few chances.”