How does a zener protect my microcontroller?
It should work fine. You might want to put a resistor (a few K ohms, it's not critical) from the sensor output to ground, assuming it's a typical PNP-output. Otherwise there will be no assured "0" level at the microcontroller input. 

Also, the 100K may be a bit on the high side. I'd use something more like 20K, and perhaps put a 1K in series with the input: 







simulate this circuit &ndash; Schematic created using CircuitLab

The second schematic is more conservative and limits the voltage such that current into the protection diodes will not exceed a few nA under normal conditions - even with +/-100V transients at the input (but may be a few mA if a +100V transient exists and the 5V supply is not present- a value which should not result in latch-up). 

An even more conservative approach is to use a BJT as follows: 







simulate this circuit

This can withstand +/-100V transients and never puts a voltage outside of the supply by more than some tens of mV on the microcontroller input under any conditions.