You can use LM393 or LM339, which have open-collector outputs.
Then you use a pullup to +5V. But you need to be careful that the inputs never go negative. That means you need to use a pullup on the input, such that when the input voltage is at its maximum negative level, the comparator input is still positive. And you compare the resulting voltage with a positive one, given by a divider. The divider is R2, R3. R6 adds hysteresis. R4, R5 ensure that the comparator's input does not go negative.
Note that the load of the circuit can have an effect on the hysteresis.
Or, you can use any comparator you like but use it to drive a transistor that has a pullup to+5V. That way you know that the transistor's output always swings between 0 and 5V.