How to made a Tri State Switch?
(This is more of a comment than an answer, but the URL has more characters than a comment will allow.)

The second circuit works just fine if V2 is limited to 0V - 4V. See this CircuitJS simulation here. If you set Vctrl to +5V then Vout is equal to V2. If you set Vctrl to 0V then Vout stays stuck at +5V. I'm not sure why your second plot doesn't agree with this. What were your resistor values?

One minor detail: note that the output is never truly "open circuit" since it's always connected through that resistor to +5V.