Rangers went in front through James O’Neill’s back post header from a Tom Tonks corner on 18 minutes.
But the hosts equalised within five minutes when Ashley Chambers pounced on a through ball and rounded keeper Tyrell Belford to slot home.
Belford produced a good stop to deny Warren Clarke before the interval but was powerless to keep out a Chambers header on 47 minutes.
Jason Gilchrist saw a third goal ruled out for Buxton on the hour mark for offside and it proved crucial with Ethan Stewart heading in an equaliser from substitute Michael Tait on 85 minutes.
Three minutes later Rangers grabbed the winner with Belford’s long clearance finding Charles who lobbed the advancing keeper Theo Richardson.