If I'm not mistaken having an NPN sensor means that the output is open collector so all you'd need to do is pull it up to 3.3V thru a resistor (say 1k) and connect it to the PIC input. (Edit: Or use the internal pullup if available).
If the sensor actually outputs 12V when "active" a simple voltage divider will do. Sensor->2k7->1k->GND, then connect the PIC input across the 1k resistor.

/Henrik.