You can swap any part between them as long as you swap every part.
You can also put 460 pistons in a 2.9 if you follow the same rule.
Seriously, this isn't dare to be different thinking. This has been discussed many times. But there is no point to it unless you are racing in a class where your truck has to pass a visual and you are trying to sneak in an advantage. Swap in the whole 4.0. That's the best solution. No 2.9/4.0 hybrid will be as good as a 4.0. A lot of work for no return. Nobody will be impressed.
But I'll play along for a moment. A 2.9 with a 4.0 crank would give you a 3.4L motor. The rod and main journals are the same, and I think the bore center spacing is the same as well. You would have to find connecting rods that would make it work. Or pistons with the right compression height. The piston heads have to reach up to the proper place within the cylinder. And even if you got it to work, you are still .6L behind the 4.0 swap--and a lot of money. A 4.0 has much larger ports and longer intake manifold runners. It's tuned as a complete system. If you mix-match parts (which it isn't possible, but just saying) you ruin the tune. You construct a turd that won't run well anywhere.
The 4.0 swap is well worth it.