The ZooKeeper "four letter words" can help. You can connect to the local ZK instance on port 2181 and execute a "srvr" four letter word. You'll get back lines of info one of which is the version.
Have a look at Exhibitor's FourLetterWord class for a sample of how to get this programmatically: https://github.com/Netflix/exhibitor/blob/40a02452dc3133fe37bf4ecf076bda99c29ab6ec/exhibitor-core/src/main/java/com/netflix/exhibitor/core/state/FourLetterWord.java