Trigger 5V relay to turn ON OFF with voltage
Your approach is correct, but the circuit will not work.  With the Q1 emitter at +12 V, the base has to be at least +11.7 V to turn off the transistor, but your control signal has a max amplitude of +5 V.  There are two solutions.

First, can you change the control signal logic polarity?  That is, can whatever is generating it be +5 V = ON and 0 V = OFF?  If so, then changing the transistor to an NPN type solved the problem.

Second, add another transistor to invert the signal going to the Q1 base.  I'll try to edit this post with a schematic later.