Simply remove the transistor and bridge the output and signal to the transistor.
You can also use a optical driver stage, i.e when you turn the transistor on it it turns on a LED inside a chip, the chip activates a photosensor which outputs the desired 5v signal, i have done it once before and it works a treat, this way the two circuits are isolated completely.