Facey netted with 10 minutes remaining with a brilliant solo run and finish after Richard Butcher had pegged Gillingham back at 2-1.
Former Gill Facey was out to prove a point against the club who released him in the summer and might have netted an opener on 15 minutes only to dither over a chance allowing his shot to be blocked.
Gillingham were struggling without their injured striker Simeon Jackson but suddenly found themselves in front five minutes before the break when Nicky Southall's free-kick ballooned off the wall to striker Gary Mulligan, who showed great strength to bundle home from close range.
Facey came within a whisker of restoring parity just before the break but Myles Weston's cross evaded him as he slid in on goal.
The home side were soon back in the ascendancy in the second half and doubled their lead with a wonderfully worked move on 63 minutes.
Barcham showed a fine turn of pace on the left to play in Mulligan, who cleverly dummied allowing Southall to sidefoot past Russell Hoult from 15 yards.
But barely a minute after Gillingham had finished celebrating, County were back in it when the home defence failed to clear their lines and Richard Butcher lashed home an impressive shot past Royce.
Ian McParland's men suddenly sensed a result was within their grasp and on 79 minutes Facey latched onto John Thompson's incisive pass, held off defender Leigh Mills before producing a wonderful finish with the outside of his boot just inside Royce's far post.
That set up a grandstand finish but it was goalkeeper Hoult who earnt himself hero status when he produced a brilliant one-handed stop to deny substitute Mark McCammon a late Gillingham winner.