Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
First thing I'd do: Crack open the case ( not a lovely job on a slim iMac), repaste the CPU and GPU, clean out fans and check fan is working properly and is not obstructed.
You’d really mess with the hardware before checking potential software issues and fixes? Brave, and maybe overkill.
 
You’d really mess with the hardware before checking potential software issues and fixes? Brave, and maybe overkill.
Experience. Knowing these era of iMacs, the age of machine and the details given, it’s likely.

One wy or another, the internals need to be cleaned and the chips repasted.
 
I come from a PC world and in there, oftentimes there is a BIOS setting to run the system in Performance/Standard/Silent modes. Performance turns on the fan sooner/faster spin to keep temp low, Silent mode keeps the fan speed to its minimum to give noise priority over temp, and Standard is the middle compromise.

Don't the Macs have similar settings?
No. Apple decides how the fans and system behave, unless you use an app to overwrite what’s possible.
Newer Macs appear to have good heat management systems out of the box, but Intel Macs suffered from Apples obsession with thin and silent machines.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.