If you need full isolation, you need transformer or opto isolation.
Opto isolators are very non-linear. To use them, you either need to convert to digital or you need to use a dual opto isolator. In those, there are two outputs which are as close in characteristics as possible to each other. An op amp is used to make sure that the output current is what is expected, and the other output should be the same.
If there is a limit to the range of the voltage difference between the devices, you could use a differential amplifier.