Here's what you need to consider:
* Engine Control Module (ECM): The ECM is the brain of the engine. A 2005 ECM might not be fully compatible with the 2004 wiring harness and sensors. You might need to swap the ECM, and even then, you could run into issues with programming and calibration.
* Wiring Harness: While largely similar, there could be minor differences in wiring harnesses between the two model years that could prevent a seamless connection.
* Sensors: Sensor locations or types might vary slightly, requiring adjustments or replacements.
* Accessories: Consider the placement and compatibility of accessories like the alternator, power steering pump, and A/C compressor.
In short: It's *possible*, but it's not a guaranteed simple swap. You'd likely need to do significant troubleshooting and potentially some modifications to get it to work correctly. It would be much safer and simpler to find a used 5.7L Hemi from a 2004 Durango. Checking the engine serial number against a parts database would also help to determine exact compatibility.