I'd say about .2 cubic inches.
Motor mounts between the two are not identical, but interchangable. the frames between all YJ's (since that is the vehicle that has the 4.2 and 4.0 in the same chassis) are all the same.
Main difference will be that the 4.2 is carbed and the 4.0 is MPI, the only real similarity is the block, and even that is different. The number of interchangable parts between the two is limited.