IC to cut off signal lines
There are some options. For example, the MC74AC245 does what your looking for—allows for bidirectional signal flow and have tri-state outputs. You need to drive the output enable line appropriately.



If this were more of a design question, let's say you want to do this with discrete parts, you could use two tri-state buffers (the one that have an enable line) and connect them up as follows:



Bidirectional buffer

Let's say your main controller is on the 'A' side and your secondary controller is on the 'B' side. You can easily control direction for the signal by driving the EN line either high or low. 

Now if you don't want to power the secondary device through the signal lines when it's supposed to be off, you just drive the EN line such that the path from A-->B is disabled. The path from B-->A would still be enabled, if you were to use the above configuration. However, since the secondary controller has its power source shut off, the B side is essentially in Hi-Z mode so it shouldn't have any effect on what you see on the A side.