On my HP 2575, it would gain a new IP address, depending on the order the computers were turned on. I set it to a static IP address so it would not change.
Print a network configuration page:
Press setup button on unit front panel
browse through menu until Network appears, then press OK
browse for View Network Settings, press OK
select Print Network Configuration Page, press OK
Check for Hardware Address (MAC) and IP address
make sure they match what your iMac says it's using to find the printer. You might check the 2nd iMac (the one that works ok) for what settings it is using.