Instead connect
S to 0V
G to D0
D to Sig and via a resistor to 5V
Resistor value needs to be low enough to operate relay. I'd suggest starting with 470R
When D0 is low MOSFET is Off and Sig is connected to 5V through the 470R resistor. When D0 is high MOSFET is On and Sig is connected to 0V
But does't this invert the signal from the esp?
Is there any fast way you can explain why my circuit does not work?
Thanks