you need to check and make sure that the sensor you have actually sinks its S_OUT to ground. By looking at that data sheet, I think it does.
There is one way to check. Take a resistor, connect it to 5volts, then take an LED and connect the Anode to the other end of the resistor and then connect the LED's Cathode to the S_OUT of the sensor. Trigger the sensor, if the LED Lights, then it sinks it's input to ground.
If it does that, then the circuit I have drawn should work.
Maybe others have more input.
You said earlier you used paste to connect the wires to the switch? Oh lord, you need to solder those to the switch. Paste (if you mean glue) won't provide a connection. Get some solder, maybe .032 inch diameter solder wire, and make sure it has flux in it. Solder those wires to those switch contacts. Don't hold that soldering iron on there too long, you will damage that small switch. If you used solder paste, you need to heat that up until it becomes a solid solder and solders the wires to the switch contacts.