Converting a 7/8spd cassette to 4/5spd
Because you can does not mean you should, however as an experiment, if it does not work you can always put the cassette back together as it was in the factory. 

Most Shimano cassettes that don't use spiders can be disassembled (usually cheaper ones). They are held together by either rivets or small screws with hex head. You can drill out the riveted one easily enough - these are no needed once the cassette is installed. 

With the right spacers, it would be possible to custom make a cassette with 3 or 4 cogs and any sizes you have availble (Do make sure the cogs a placed in ascending order, although ). The shifting won't work smoothly, as the ramps and stuff on the cogs will be in the wrong places.  

Refer Sheldon Brown - section "Building Custom Cassettes"