I hate to tell you but I seriously doubt that a second Gen engine will couple with a first Gen transmission. Motor mounts may be in different locations. Wiring harnes will probably be different.
Do you know if you have a J35A9 engine or a J35z1 engine in your vehicle? The A9 was used in the 4WD models the Z1 was used in the 2WD vehicles. The A9 is a non VCM motor, the Z1 and Z4 both have VCM.
You probably have the 4 gear shaft H5 transmission in your 06 Pilot. Did your friends vehicle have a 5 speed or 6 speed transmission? The H6 was introduced in 2010. There are far too many unknown variables to answer your question.
Of course if you have enough money anything is possible.