Proximity sensors interfacing with microcontroller
The GX-H8A has NPN type open-collector output, so it should work exactly as you described.
The 10k pull-up can make the signal rise quite slowly, but it should not matter much, I just mention it so you can change to stronger pull-up if it is a problem. If the rise time is not important and the internal weak pull-up of the MCU is enough, you can also try without external pull-up.