First, there's nothing wrong with you asking for help. I find it strange that your master thesis mentor objected. Indeed, master thesis is intended to teach you how to do research, and collaboration (or simply talking to experts in other fields) is a crucial aspect of it nowadays. You are not supposed to re-invent the wheel!
Generally, many mathematicians are fond of explaining maths to others, and seeing a problem someone cannot solve, they often cannot resist a challenge! So, if you ask for help, you do have a chance. Much more so if (a) ask someone you know in person and (b) ask someone working in a right domain. Alas, we are not generalists anymore, so don't an expert in category theory to know PDE or be willing to learn them for you! If you do shoot an e-mail to someone you don't know, it's hard to beat the advice of Scott Aaronson.
Actually, if a question went unanswered on math.stackexchange, it is considered acceptable to ask it on MathOverflow. By the look of it, though, MO welcomes more concrete and precise questions than yours on Math.Stackexchange. You should state the problem and what you are trying to achieve in full, refer to "most similar" problems you know of in the literature, and what exactly goes wrong if you try to mimic their method. Since MO is supposed to be "like asking your colleague next office door", the same applies if you ask/email someone.
On the issue of collaboration, I would say that if you asked for help and received valuable input, then you should offer a co-authorship. After that, it depends. If the answer is in the literature and they just point it out to you, or if it is standard for the experts even if hard to pinpoint in the literature, then they are supposed to refuse, and you just mention them in the Acknowledgements section. If, on the other hand, they start thinking or doing computations for you, then it's a different matter. Of course, there are many intermediate possibilities, e. g., they just write the math part in a separate paper, and you cite it, or they write a separately authored appendix to your paper. But it's up to the person whom you are asking for help to decide.