The human body system is designed in such a way that what happens to one part affects other parts. And this is evident is the production of sweat via the skin whenever we are stressed, pained or under discomfort. However, this occurrence can be supported by the physiological interplay happening between the sweat gland responsible for the secretion of sweat and hormone in charge of stress regulation.
To put it more correctly, these two endocrine chemicals are connected in the sense that they are controlled by the same endocrine system. And so, whenever sweat is caused by stress or pain, it shows that the sweat gland is been triggered by the concurrent secretion of stressed hormone. This would definitely caused the sweat to be released via the sweat pores that are on the skin.
Interestingly, the production of this sweat would automatically cease when the stressed hormone is normalized.