LM239 Supply/Open Collector Output Voltage
Since you have an open collector, the voltage used at the collector is independent from Vcc.  Therefore, you can connect the collector to 24V supply, as long as you limit the current to 20ma max.  In calculating the max current, assume the transistor is a short, so your limiting resistor should not be less that 1.2K ohms.