I'm quite sure the 5 speed won't be a cassette. It's probably a spin on freewheel. I've never read any online messages talking about a 5 speed cassette - and even 6 speed cassettes are rarer than hen's teeth.
What's the drop out spacing of the frame (probably 126mm, but could be something else)?
What's the lock nut to lock nut width of the 7 speed Shimano hub/wheel (probably 126mm but could be 130mm)?
What sort of shifters and derailleurs are on the bike and/or what do you want to put on it?
You're in luck with the chain: 8, 7, 6, and I think 5 speed all use the same chain. If the 7 speed wheel fits the frame, and if the bike has non-indexed shifters, then you can likely run that wheel as is.