If it's an '05-'08 5.7L it will work. You'll need to swap over the front cover, oil pan and manifolds as you mentioned. Not sure if the oil pick up tube is the same or not. Also remove the EGR blocking plate from your '04 engine's cylinder head and put it on the 300 donor to delete the EGR. Make sure to use exhaust manifold gaskets for the Ram and not the 300. You can just leave the MDS solenoids unplugged, your '04 PCM won't be looking for them anyway.
Also, if the starter for the 300 is on the passenger's side you'll need to use the plate between the bell housing and block from the '04. May need to clean out the main engine ground bolt hole on the block as well.