This thread is quite old but if he was actually able to make it work what you have to do is get a new not programmed ECU from Nissan for a 2007 (or find a company that is able to reset them) Then use the entire wiring harness on the engine. There is 100% no reason to remove the harness from the engine while removing so why anyone did and was trying to make the old wrong one fit the new engine is beyond my comprehension.I have the same problem you had with your truck, except mine is an 04 and the engine is 2010. I was wondering how you resolve your problem. I would really appreciate your help or anyone help.
The issue that comes in though is that Nissan may not be able to program the newer ECU to an older truck. The 07's share most of the exact same stuff as the 04-06 though so it's the best bet of making it work.