Do you want to protect against ESD or do you want to protect your inputs from higher than 5V at the input.
If you want to protect against ESD, anything above the maximum allowed voltage on the contacts should be shorted to ground. There are TVS diodes for many different voltages, so you could choose one for maybe 15-20V or even 30V. That way the 12V will not be passing through it at all, and only high-voltage transients will be shorted to ground.
If you want to limit your input to 5V regardless of the voltage coming in, you could use a medium value resistor like 330-1000 ohms in series, and then a 5.6V zener across the signal line (between the positive end and the ground). You could also place two such zeners back to back to protect against over-voltage of both polarities. You can also try 5.1V zeners and 1k resistors and see how that works for you. GenerallyBasically, the higher the resistor value, the lower the current through the resistor and the zeners, which reduces wasted power and added heat at higher input voltages, plus it improves the protection.
simulate this circuit – Schematic created using CircuitLab
TVS diodes are almost a million times faster than zener diodes, but since you have these resistors and a slight zener capacitance, that will provide some latency and reduction of the ESD pulse before the zener even starts conducting. Circuits usually have some inertia (impedance) and the fastest transients usually don't go too far. But you could include TVS diodes instead of zeners here. There is a 5V bidirectional TVS diode by Diodes Inc, model number DESD5V0U1BB-7. No need to parallel them with zeners, TVS can work just like a zener, only faster.
NOTE: I see that you are using this for a binary signal. I just want to warn anyone thinking they can use this kind of protection with an audio signal that it would cause distortion for signal voltage peaks above 5V.