DC Voltage Range Controller
Something like this: 







simulate this circuit &ndash; Schematic created using CircuitLab

For a real circuit you'd want a bypass capacitor across the supply and probably an RC low pass filter on the input. 

The comparison voltage is 9.0V when the relay is off and 5.0V when the relay is on, so there is 4V of hysteresis. That is achieved by the R1/R1 divider and D1/R6 sets the hysteresis when the relay is on. 

Q1 will drive a relay up to about 100mA coil current. D2 is a flyback diode to deal with the relay coil inductance. 

R4 is to prevent output leakage from being amplified by Q1, R5 sets the base drive current when the 12V relay is on.