Connection to Photoelectric sensor

There is not much information there.

This implies an input voltage of 12 to 24 volts:

Photocell E3JK-5DM1 DC12-24V

This could imply 2 power wires (+Xvolts and GND) and three relay wires Common, Normally Open and Normally closed :

Output mode: AC and DC universal five-wire relay output, normally open + normally closed