Hoist the back wheel off the floor, and then turn the cranks by hand while you try and shift into 5th gear. Then you will be able to see what is rubbing or skipping. If this is a 5 speed bike, the rear derailler limit screw may not be letting the derailer move all the way out, so the chain doesnt drop onto the 5th spocket properly. Do a search for the Sheldon Brown and Park Tool websights to get all the details of gear shift adjustment.