Here is a diagram and parts list. Looks like you could pull those seals and replace without removing housing. If you have to remove housing it may take a special wrench to unscrew it. Buy if you have worked on pumps and such I’m sure you can figure out getting the seals out without that.
Mercury Marine 40 HP (2 Cylinder) Gear Housing (Propeller Shaft) (2.00:1 Gear Ratio) Parts