Callum McGregor helped deliver Shaun Derry's first win as Notts County boss with a brace against Gillingham.
McGregor put the hosts in front with a deflected shot after Bradley Dack poked an early Gills chance onto the post.
Dack was denied by Bartosz Bialkowski before half-time, only to level from close range after the break.
Celtic loanee McGregor slammed Notts ahead again, then cleared an Adebayo Akinfenwa effort off the line before Jack Grealish rifled home a third.
The Aston Villa loanee's wonderful solo effort, beating three Gills defenders on the way to his powerful finish into the roof of the net, was his first Football League goal.
Notts' first victory in eight games in all competitions lifts the League One bottom side to within three points of safety.
All sides above them, however, have a game in hand on the Meadow Lane club.
VIEWS FROM THE DRESSING ROOM
Notts County manager Shaun Derry told BBC Radio Nottingham:
"I'm absolutely delighted, obviously. We have raised the bar these past two weeks in particular with our performances and not got anything out of the games. Today, we fully deserved the three points.
"What we have to do now is crack on, take it into next week's game, then it into the week after that. It can't just be one day - it has to be every single day. That is what I'm striving for.
"Nothing changes, we are still at the bottom of the league. But we are bottom with a team now that is in a different place to when I first walked into the building."
Gillingham manager Peter Taylor told BBC Radio Kent:
"I thought the performance was OK. We created enough chances.
"I'm very disappointed with the finishing and I'm disappointed with the goals we conceded.
"The third goal, Grealish is a very good player but we made him look like George Best.
"I was confident we were going to score but then we had to not give anything away."
Notts County 01 Bialkowski 24 Freeman 37 Fox 28 Boucaud 06 Leacock 03 Sheehan 20 Campbell-Ryce 04 Liddle 10 Haynes (Ball - 63' ) 07 Grealish Booked 08 McGregor Substitutes 05 Smith 09 Showunmi 11 Bell 19 Murray 22 Fotheringham 23 Speiss 38 Ball Gillingham 01 Nelson 23 Harriman 03 Martin 18 Lee 28 Daniels 26 Barrett 15 Dack 31 Hessenthaler (Akinfenwa - 66' ) 09 Kedwell 19 Hollands (McDonald - 75' ) 11 Weston Substitutes 04 Linganzi 05 Davies 06 Legge 07 Whelpdale 08 Akinfenwa 10 McDonald 21 Howard
Ref: Jeremy Simpson