What year was the 6 cyl and was it a 4x4 or a 4x2?
If it is coming out of a 6 cyl that is appropriate year range and is the same drive type as your truck (2wd versus 4wd) it should work. Both the 3.9 and many 5.2's used the same NV3500 trans and even the same clutch components. Other 5.2's and the 5.9 also had the NV4500, which is what I would look for instead of a NV3500 if I were contemplating this swap.
I think you need a custom crossmember to support it (versus the auto trans crossmember which is different I believe), and I think you will need a PCM from a manual truck too. Then all the physical pieces that your auto doesn't have (like clutch pedal and shifter through the floor, etc...). It could be done, but it will be kinda $$$, even if you get the transmission for a good price.