Graham Burke's unstoppable second-half strike looked to have steered Notts County out of the relegation zone on the final day of the season.
The Magpies gave themselves hope of surviving the drop when Burke put the visitors ahead.
A quickly-taken free kick from Liam Noble found Burke in space and, from a tight angle, the midfielder unleashed a rocket of shot that beat Glenn Morris and saw County edge closer to securing their place in the third tier of English football.
However, those hopes suffered a setback when Egan bundled the ball home following a goalmouth scramble in the 88th minute.
The Gills then took the lead in the third minute of injury time when Dickenson fired home.
As County committed players forward in a bid to get back into the game, a break from Norris saw the forward score Gillingham's third as the Magpies fell two points short of safety.