replacing pushbutton in unknown circuit with optoisolator

Hi dc.
I have, it's ~12V. The pc817 has the following max ratings on the output:

Collector-emitter voltage, VCEO: 35 V
Emitter-collector voltage, VECO: 6V