The way I would do this is to wire the potentiometer as a voltage divider.
Because your source is 24V DC, and you only want 0-10V DC for the analog input, you need to have 7000 ohms in series with the 5000 ohm potentiometer, instead of the 1000 ohms you have now.
If the fixed resistor is R1, with a value of 7000 ohms, and the potentiometer is R2, with a value of 0 to 5000 ohms, we can use the simplified voltage divider equation where the voltage drop is proportional to the ratio of the resistances:
V
R2 = V
total x ( R
2 / R
Total)
With the resistor at full scale:
V
R2 = 24 x (5000/12000) = 10 volts
With the resistor at half scale:
V
R2 = 24 x (2500/12000) = 5 volts
With the resistor at zero scale:
V
R2 = 24 x (0/12000) = 0 volts
This is a lot easier to measure, too, because you can just put a simple digital or analog voltmeter in parallel with the input terminals.