The 5-speed bike is probably spaced 120 mm and the 6-speed is 126 mm so the 6-speed freewheel is too wide to work on the 5-speed hub. As vpiuva noted, the 6-speed freewheel will stick out beyond the locknut on the 5-speed wheel. Also swaping freewheels is likely to cause skipping as they will no longer match the chan unless both chains and both freewheels are nearly new.
Recommendation: have the 6-speed wheel relaced with a new rim.