I haven't used glue sticks for sewing, so can't specifically answer your question.
However, if you should have a gumming problem, just use an alcohol swab and wipe the needle til clean.
I keep a bunch in my sewing machine drawer all the time.
It helps if/when the needle gets gummy from 505 spray.