What does it have now, a 4R70W or a 4R100? Look on the door jamb sticker for the TRANS code, a 4R70W is "U" and a 4R100 is "E".
They are not interchangeable. In general, the same transmission out of a 99-03 V8 2wd F150 will work, the newer the better.