Welcome to TRS
You would have a 2.5l SOHC Lima engine in a 1999 Ranger, last year of 2.3l SOHC Lima was 1997
2.5l SOHC Lima was used from 1998 to mid 2001 in Rangers then replaced by the 2.3l DOHC Duratec 4cyl engine.
2.5l lima was a stroked 2.3l lima so same engine except for different crank shaft and longer connecting rods
1998 Rangers got the new Returnless fuel system, so you would want 1998 and up.
I think 2003 was last year of analog dash, so you would need that
Engine swap requires its computer and wiring harness also transmission if automatic, so your not just swapping the engine, unless it's exactly the same engine.
Also need exhaust and radiator
4cyl has a cross brace in engine bay for drivers side motor mount, which V6s didn't need, so you have to add that.
You might be better off swapping body parts, whole cab, or just fixing the floor panels if the rest of the body is OK.
If drive train is currently working well, and just the "eye candy"(body) is the problem then change the eye candy
Extended cab just had longer rear drive shaft, but also weighed more, so maybe not the best choice for 4cyl engine swap, but yes you could do that
EDIT:
I see you also have 1990 in title, so maybe not a 1999?
The above still applies as far as the swap, engine, trans, wiring harness and computer needs to be swapped over
1994 and earlier would be best choices for engine swap, 1997 and earlier for body parts only