As HBloomfield said, you do NOT have to remove the sensor from the iMac body. Instead, remove the sensor from the HDD while it is still connected to the body.
If the sensor is covered with a 4mm black foam square, use your index fingernail to scrape off one of the corners where there is adhesive. If you pull on just the foam part, it will tear the foam.
If there is some clear tape holding the excess play in the HDD thermal sensor wire, against the body back, peel it up to free the wire and give yourself as much free play as possible. When reassembling, tape back to the body.
I had great success with just propping the top edge of the LCD display up with a box about 8" long. By doing so, I didn't have to remove the thermal sensor wire or the power cable.
The power cable actually has a fair amount of play in it IF you peel back the thin black tape that affixes it to the LCD panel side to expose the power cable connector on the LCD side.
I actually didn't have to remove the cable. With the iMac laying on its back, just rotate the front bezel (bottom edge rotating around top edge) so that it's laying upside down, above the iMac. When reassembling, just rotate back into place.
Be very careful - this connector very difficult to disconnect, and you have a high risk of pulling the cable pins out of the connect. If you have disconnected the 3 other cables, you can have a helper rotate the screen out of the way while you remove the hard drive.