I know terminator engines ('03-'04 Cobra) have been swapped successfully into the Mark VIII chassis but I am not aware of any 5.4 swaps. I wouldn't think the Mustang ECU would handle the transmission duties but you may need components of the harness to splice in? You could use a stand alone engine and/or transmission controller.
Sorry I couldn't be of more help but I wish you the best of luck and hope you share your progress!
I awoke in the middle of the night thinking about this.
I vaguely remember one Mark VIII I ran across years ago on the Hot Rod Power Tour that I believe had a 5.4L engine. So this morning I started Googling...