C64 also needs 9VAC for sound chip and some other chips.
The 9 volt AC is used to supply power via a charge pump to the SID sound generator chip, provide 6.8V via a rectifier to the cassette motor, a "0" pulse for every positive half wave to the time-of-day (TOD) input on the CIA chips, and 9 volts AC directly to the user-port. Thus, as a minimum, a 12 V square wave is required. But a 9 V sine wave is preferred
Like wikipedia says.
It will not work properly with only 5V DC.
Also you might use that charger for 5V, but it charge voltage is probably over nominal 5 volts. PSU cant push more amperes in device than it takes at specific voltage. Constant current means that it gives no more than specified amperage by lowering voltage. I=U/R.
I don't encourage to try with it nor built your own psu. My best opinion is to try find working original transformer, or buy
this for example(expensive thou). Or find cheap 5V switching wall pack and 9V transformer and connect them together to DIN connector.
Do you still have orginal PSU? Somebody could be able to fix it.