Some sort of capacitive pickup. Try seeing what you get out of a piece of wire parallel and about an inch away from the wire. This could feed some sort of voltage divider with a 5.1V zener diode clamp. This should output a square wave analog of what's on the wire.
Some sort of inductive pickup. 2 inch diameter coil, try a few turns coaxial to the wire. It will be an edge detector, producing a pulse when the voltage turns on and a pulse when it turns off (magnetic field build and collapse).
I'm assuming that this electric fence is pulsed DC in all this. And the pickup mechanism will have to be well insulated, kept from absorbing water and away from where your inmates can do physical damage.
(Or really rube goldberg, get one of those Neon fence testers and have it trigger a phototransistor. There's your HV optoisolator!)