If you want to put the energy from the capacitor into the 24V rail then you will need a buck converter. Then once you have the capacitor down to say 30V you can dissipate the rest with a resistor. But 5mS is not long, and you are going to have to dissipate about 50W on the 24V rail. Will the power supply mind that it is supplying a load that effectively pulses at 100Hz?
If you are testing a charger why use a capacitor as the load, unless you want to test high current impulses, which could easily be emulated with a power transistor (or multiple in parallel depending on the current). Could you use a resistor as the load, or put a resistor in series with the cap so that you have much less energy to deal with? (Remember the energy stored in a capacitor is proportional to the voltage squared.)
Regards,
Jovian.