Never did it, but depending on where it is and whether you can see it or not, I'd try a number of jabbing tools. (Sharp pointy objects to spear it.) Do you have a rubber cap or one of the plastic ones?
One handy tool is a pickle or olive extractor tool. This is a device you should be able to pick up at a kitchen store gadget section -- made to pluck a pickle or olive out of a jar. It's got grippy prongs at the end of it that close up with you pull it up.
Good luck!
(Or, just leave it there and buy a new cap!)