Using a slightly modified version of this post, I managed to get this working:
(defun my-neotree-project-dir-toggle ()
"Open NeoTree using the project root, using projectile, find-file-in-project,
or the current buffer directory."
(interactive)
(require 'neotree)
(let* ((filepath (buffer-file-name))
(project-dir
(with-demoted-errors "neotree-project-dir-toggle error: %S"
(cond
((featurep 'projectile)
(projectile-project-root))
((featurep 'find-file-in-project)
(ffip-project-root))
(t ;; Fall back to version control root.
(if filepath
(vc-call-backend
(vc-responsible-backend filepath) 'root filepath)
nil)))))
(neo-smart-open t))
(if (and (fboundp 'neo-global--window-exists-p)
(neo-global--window-exists-p))
(neotree-hide)
(neotree-show)
(when project-dir
(neotree-dir project-dir))
(when filepath
(neotree-find filepath)))))
Key binding to toggle, example:
(define-key global-map (kbd "M-e") 'my-neotree-project-dir-toggle)