Relay to switch lights on from gate motor
A alternative approach would be to install an industrial limit switch, positioned so that it is open-circuit when the gate is fully closed. Use this to control your lights, which will be on whenever the gate is open.
There would be no daylight disable function, however.