It appears that your intention is to have the output voltage roughly mirror the input voltage when the input is driven to a voltage below 2.3 volts, and otherwise have it passively pulled up to five volts. As implemented, the circuit will also have the effect that any current sourced into the output must be sunk by the input; it is unclear whether that behavior is desired, or simply tolerated.
If you wish to have the output be low when the input is floating, then you must either have whatever would pull the output high refrain from doing so except when the input is high, or you must have something which can sink current to ground when the input is floating. It will be necessary to either use a transistor in an inverting-amplifier configuration, or use two or more transistors operating opposed; two transistors are going to be necessary in any case. If you need a two-transistor circuit whose output polarity matches the input polarity, the simplest approach may be to use a pair of common-emitter inverters, though an alternative might be to adapt your circuit to replace the output pull-up with a PNP current source (a pull-up resistor to 5 volts will source five times as much current into something trying to pull that pin down to ground, than it would invest trying to keep the input above 4 volts; a current source could supply the same current in both cases).