I think for this particular question you may need to a little bit of work to get the distance from democracies (however I can't imagine it's too complex depending on the specifics)- but I believe it'll be possible to build using the University of Gothenburgs Quality of Governance dataset, which is available here:
I concur with Jason's point made earlier: I am not aware of any such specific dataset. But the core question seems to me: Is you key challenge to identify which nearby countries qualify as "democracies" - in which case there are lots of datasets to determine that, but they will not agree on all cases - , or is the key challenge how to measure exact distances (and if so, for what purpose: I would assume that the literature on democratic diffusion / autocratic diffusion will help, but likely has answered at least some of the questions for which "distance from the geographically next democracy" might be an indicator.
I would definitely give the question of the choice of proxies another thought and make sure that this really is a good indicator for what you really wish to find out.