I would say they are close.
One is a '97 and the other is a '99 according to the first two digits in the code information. Both are 16HP V-twin design according to my quick online search. and will bolt up because they have an industry standard bolt pattern. The difference come with the wiring and how the two compare. Also, the crank length and diameter may be different.
Do both machines these engines come from have an electric PTO option?