Bi-Directional Multiplexer?
You're probably going to want to use analog switches, for example the TS5A3159A from Texas Instruments (not a product recommendation, just an example):

http://www.ti.com/general/docs/suppproductinfo.tsp?distId=10&amp;gotoUrl=http%3A%2F%2Fwww.ti.com%2Flit%2Fgpn%2Fts5a3159a 

It has an enable pin which connects the common side of the "switch" to either the NO pin or the NC pin. The switch is bidirectional, so it doesn't matter if the signals on the pins are inputs or outputs.



You can also find other analog switches with multiple circuits, such as the ADG1434 from Analog Devices: 

https://www.analog.com/media/en/technical-documentation/data-sheets/ADG1433_1434.pdf