What limequat said, use your existing 06 PCM, wiring harness, etc and swap fuel rails so you can use the 06+ style fuel system. However, you will be going backwards in time and getting an engine with ~10-15 less hp/tq than the 06.
Now if you were going to put an 06 into an 04, use the 04 PCM, harness, and swap the fuel rails for the 04 ones. This is an upgrade and will give you the extra hp/tq from the redesigned engine.