I'm not sure you'd want to use the backup from your other Mac, because to do so you'd have to erase that drive. If it's big enough, after erasing, you could create two partitions, one for each Mac.
Cloning a drive for the first time, however, can take some time and it might not make it through all the way. In that case, you'd have lost the data from the other Mac for nothing. So, this is kind of a rock and a hard place thing right now. 😟
If you've backed up your important stuff, then, if you determine the drive is failing, you can move that back over after you have a new drive installed. (I don't think your iMac is that easy as a DIY project. But depends on your skills.)
To get an idea what's involved, you could take a look at these excellent, illustrated instructions. You can find your model here. The EMC # is located under the foot of the mac.
http://www.ifixit.com/Guide/Browse/iMac
For cloning. I use Carbon Copy Cloner, freeware. It's very popular, easy to use and highly recommended. There are other ones out there, such as superduper, and tri-backup (this one not free.)
http://www.bombich.com/
Once you get this sorted out, you definitely don't want to be without an external, bootable clone.
SMCFan control
http://www.eidac.de/
EDIT: You could open up Console in Applications>Utilities. In System Log, see what kind of entries there are just before these events, and just after booting up again. There might be some clues there as to just what is going on. I'm not great at reading these, but you could post parts of these logs. Might be able to tell if it's heat related.
Message was edited by: WZZZ