Xanax is used to treat anxiety and panic attacks, whereas Gabapentin is an anticonvulsant and is also used to treat neuralgic pain.