I wanted to write a comment to supplement the fine answer by @Chris H but it was too long, is important, and can pass as an answer. The literal "yes/no" answer is as ChrisH says.
Chewing gum can moisten your mouth because the water is being taken out of your body. Some of that can be re-absorbed, but some will be lost. That is: by doing this you may feel better temporarily, but you are dehydrating yourself more in the end.
Chris suggests this is a small effect, but I would say that depends on how dehydrated you already are.
Severe dry mouth from dehydration can be painful but should usually be ok short term. I have had it to the point it was painful many times, to the point that it affected my sleep wherein I was dreaming about drinking as much water as I could with no relief since it was just a dream (in fact, I have had that exact dream many times; it is not uncommon when my mouth is way too dry).
If you go for hours in this condition, assuming you are not keeping yourself dehydrated over the longer term of many days, my experience suggests you should be fine. I do not suggest that you be carefree about it, so please do not take that from what I say, as dehydration can be dangerous. And, as you probably experienced, it is annoying enough that it can detract from the quality of your hike. But in the long term, you should be fine even if you decline the gum, and I personally would decline it whether I was severely dehydrated and couldn't spare to lose a drop, or even if I was only slightly dehydrated.
If you go all day like this and cannot stand it, personally I would rather relieve the discomfort by adding water from around me rather than relieving it by removing water from my body. In fact, you could make something similar to gum by taking a plant which is wet inside and chewing on that instead as if it were gum. Or, better yet, drink the sap from a plant then just chew on what's left of it.
Of course, the usual warnings about knowing your plants and beware of toxic or poisonous plants applies.