I had the same problem, my gecko had pinworms and had to get a few doses of panacur.
It wasn't all that easy, but I used the brute force method.
I hold the gecko in my hand so that his head rests between my thumb and the part of my palm below the index finger. I gently hold the gecko like that so that he can't move, and holding him upside down helps too and prevents struggling (disoriented I guess).
I then use the syringe I got from the vet (insulin syringe), draw up the proper dose, and pull the needle off. I gently press the plastic tip to the side of his mouth and try to coax him to open his mouth. Sooner or later this will agitate him enough to bite the syringe, and at this point I slowly (make sure you go slow so he doesn't choke) press the syring plunger. Then here's the tricky part, my gecko doesn't seem to want to let go of the syringe, so I let him hold onto it, and put him down along with the syringe, and then once he gets back on his feet he usually drops the syringe.
Hope this helps. Don't be squeamish about holding your gecko, they're not all that fragile (just don't squeeze), hold him like you would hold a quail, very slight pressure just behind the neck is all it takes to keep them from running away and the rest of the body just needs support.
He will be mad at you for the next couple days though, so don't plan on handling while dosing panacur.
-Lemur 6