Circuit to get a short at 0 volts and open at 3.3/5 volts using transistors
The easiest way to do this is to use an opto-MOS SSR, such as this one (CPC1117N): 



It takes a mA or two to turn the output transistors off, so a 1K series resistor on the control input will be suitable for limiting the current (for either 3.3 or 5V). 

This particular one can handle 100 or 150mA continuous, but there are others that can handle more current.