Are you hoping to preserve the nails?
If not, you can probably clamp a small pair of vise-grips on them, coming from straight above. It may mar or deform the nail heads, though.
If you want to protect the nails, a tool like a tack puller may be the best. It's basically a flat screwdriver with a slot ground in the middle (you could make your own). Alternately, a small cats-paw nail puller from the hardware store may work.