Hi, I'm not a big expert in the field, but I made an "analog" optoisolator at a hardware hacking lab and it worked quite well. I think it is one of the cheapest solution for your problem.
You simply need a photoresistor, or light-dependent resistor, such as these
**broken link removed**
and a Light Emitting Diode, or LED, such as these
**broken link removed**.
The photoresistor is a resistor whose resistance depends on the amount of light to which it is exposed. Then, if you tape together a led from a circuit and a photoresistor from another circuit, with electrical tape, when the led is on the resistance will go down, and vice versa. You can then use your signal to light up the LED, which makes the resistance go down, "closing" the other circuit.
This probably isn't the perfect solution, because you still have a big resistor and not an open circuit when the light is off, but it's cheap (less than 1$) and manages to keep the two circuits completely separate.