And this is before we even get to considering the different current handling ratings of the pins between the the larger gauge contacts in the four contact connectors and the smaller contacts in the fives.This is correct. DO NOT try to run power though a 5-pin cable. Aside from the 22awg wires not being rated for it, there are so many other bad things that could happen, as @venuetech mentioned. Use a proper 24VDC power supply and proper 4-pin cable. Do it right, or don't do it at all.
This is just a terrible idea!!! Think for a second about what would happen if you connected the +24VDC and -VDC together onto one pin, then supplied power.
...
...
...
Okay, that was more than enough time. Not good, right?! If you don't know the answer, I don't think you should be doing something as simple as connecting a cable to a power supply and a device.
No! Wrongo!! Don't do it!!! Bah humbug!!!!
Toodleoo!
Ron Hebbard.