No, PWM will not work. But if you can use the controller to supply a 100% duty cycle PWM (and I mean absolutetely 100%) then it should work assuming the controller can provide enough current to power the relay (this is probably going to be the biggest problem if you are using a medium sized or larger relay). Personally, I don't think you really need a capacitor- you can just use code or whatever to make a 100% PWM pulse can't you. I don't think the cap would work the way you think it might either, because of the current demand- it's not just voltage a relay needs.
BTW put a diode in reverse parallel to your relay control terminals to protect the electronics against voltage spikes from turning the relay off (disconnecting power to the inductive magnetic coil). Reverse parallel- in the direction so doesn't short the PWM pulse across the relay control terminals but allows current to flow in a loop around the relay coil and diode.
Oh, if your PWM controller get's very VERY close to 100% but not quite, a capacitor too in parallel with the relay coil (like the diode, but make sure the polarity is the right way) should help that (in this case). It might help smooth out that very momentary dip that the PWM pulse might have even at 100% duty cycle. But if it's 100% you don't need it.