Will a 2005 Ford Explorer 4.0 v6 engine go into a 99 ford ranger, if not what small trucks will it work with?

I just had to rebuild the engine in my 2005 Ford Explorer 4.0 v6. Was wanting to know if it could go into a 99 ford ranger, if not what small trucks or cars are interchangeable?

Can check with a local salvage yard to see. It should, but you you may need the engine and computer and the wiring, will need to check mounts, etc. May wind up costing more than fixing 99 engine