Yes, if they are the same 20-pin ATX connectors, the power supply will work, as long as it can supply enough wattage for your setup. The extra 4 pins are redundant voltage lines or something to that effect, and it was a new atx standard that replaced 20 pin atx for the increasing power draw of new components.
My current PSU setup has the 20 pin M2 plugged straight into the 24 pin motherboard header, leaving 4 unplugged and exposed. My CPU is powered by a molex-to-4 pin converter. Everything works great!