from light research i have done on 4wd swaps, you are in for quite a bit of book work and research to make sure you get all the right parts the first time.
there is an advance adapters plate to use standard 5.0 bellhousings behind the 2.9/4.0
if the 05+ v6 stang still uses a T5, that may indeed be an option also.
you will also be lookin for a method to attach your t-case. obviously the mustang variety of T5 is meant for a 2wd application, so that tail shaft wont work.
shifter location is pushed back in relation to the M5 tranny you currently have also. there has been a few(that i know of) completed tailshaft and housing swaps done on a ford T5 to use the S10 midshift location.
if the t-case pattern and output splines are the same for an S10 and ranger, using a 4wd S10 tailshaft and associated parts would effectively kill two birds w/one stone.
i know the output of the 2wd T5 and 2wd M5 are the same, not sure on 4wd applications.
good luck, and HTH.