3 very fast optocouplers would be needed to have full isolation, if you need ABZ signals.
-
If you already have drive and Mesa wired and working, use a DVM to measure the AC and DC voltage between drive encoder gnd and Mesa encoder input GND, any reading above 0.1V means using optos, but if they are under 0.1V it will probably be safe to wire just ABZ signal pins to Mesa.
You have to measure those with drives off and again with all drives on and working as drives cause a lot of EMI.
It would be even better if you have a scope to actually see how much interference is there as the DVM is not very good at that.
Again, do this at your own risk, there are to many variables there to be certain.