From your description - and like many other iMacs of that vintage, the clicking sound your DV 400 model is making could be a sign of P-A-V (Power-Analog-Video) board failure, which delivers the high and low voltages to the computer's components. Does the screen remain dark the whole time? Because high voltage is stored in the capacitor adjacent to the P-A-V board, the CRT must be discharged to replace the part. This repair involves the potential for serious electrical shock (or worse), so most users have to decide whether to retire the iMac or spend the money to pay for professional diagnosis and/or repair. A new P-A-V board isn't available anymore, so your only option is buying a used/pulled one. Installing a used P-A-V board is a gamble, because you'd never know in advance how much remaining service life it has, so it could fail at any time. After replacing the board, there are additional internal adjustments that must be made, so it's not as simple as screwing in a part, plugging in the necessary wires, and then closing the case.
thanks a lot for your detailed reply!
Yes, the screen remains dark.
The computer was not used for a long time and was located at a friend's home.
When he tried to switch it on some weeks ago, he booted into OS X and then suddenly shut off.
That also happened, when I saw the imac again for the first time some weeks ago: I saw the OS X desktop and some moments later, he shut off again.
I'm not sure, what happened at the 2nd try, I think it did not even boot any more.
Replacing the PRAM battery did not change that.
It's a pity, if it is so difficult to repair as you say - so I will definitely do not invest more time or money in this beautiful, but very old machine.
May the imac rest in peace - I'll try to find somebody who enjoys repairing old machines.