Rule of thumb is domestic lawn tractors have 1" pto shafts and commercial ones have 1.125" shafts
So the engine should fit.
Wiring them up will be a pain so before you pll the new engine out, follow the wires & label them so you will know haw to hook them up together.
In particular check the alternatos & rectifiers ( if there ) which is where most come unstuck.