NPN and PNP are transistor types. Transistors are like switches, strangely picky switches.

An NPN switches power to ground. A PNP switches power off the power rail.

So if you have an NPN output sensor it is going to switch something to ground.

If you wanted a Voltage, connect a resistor between and NPN output and the Voltage rail.

More likely you want a current. To avoid interference CNC folk tend to use opto-isolation, the output turns on an LED which shines on a detector, which probably has an NPN output, but someone else can worry about that one.

The only sensible way to drive an LED is with a resistor off the Voltage rail, through your LED, through the NPN output to ground.

If it is a silicon transistor you will have a 0.7V drop across it, probably another 1.2V drop across the LED, use whatever is left to calculate the resistor value.