I don't think there is a systematic method that applies in all cases, but there are some things you can try.
- You can use your own knowledge of what people are working on, or do a (more or less) systematic literature search to find out if someone already has worked on the problem, or at least a related problem. If the problem has a distinct name (or several), an hour or two with a search engine might be well spent. Once you find a relevant paper, explore its references, as well as the papers citing it, and so on.
- If you don't find an obvious name, then you can still try contacting some of the relevant authors directly to see if they have a better idea on where to look.
- Use your own network (including e.g. PhD advisor and other professors) to ask for more leads. (I use the word 'leads' because it really is detective work sometimes, but it does feel good when it pays off.) Be prepared for the "I don't know the answer, but you should talk to X" response, and then X saying "I don't know, but I think Y worked on this during the 70s", etc.
People you identify using these methods are more likely to be interested in the problem than a random person, or at least to have some ideas or insight. On the other hand, if you're not in the field it can be really hard to identify the right people, or even judge what problems are related. And, of course, this way doesn't find all those who are interested but haven't published on the topic before - like early-career researchers.
What else can you do?
- It's indeed worth trying various websites (like StackExchange, Quora, various forums, ...). Particularly those geared towards professionals in a specific field (like MathOverflow) can be very helpful, but can also be a bit hit and miss. If you're dealing with specialized knowledge, that's just how it goes. Still, such sites can often help with less systematic, more field-dependent ways of finding the right person to talk to.
- Various professional organizations may have "networks of experts", which are basically lists of people willing to talk to media or the public about topic X.
- Finally, sometimes plain old publicizing the problem, or even offering rewards for a solution, can help attract talent - especially if it's a somewhat obscure problem with practical utility. As for rewards, if you're a professor this is called offering a student a problem to work on... If you're in industry, you could try to get a professor to do some consulting work, and so on.
If all else fails, you could always work on the problem yourself. Having done the full literature search and talked to various people, you might well have come up with some ideas on how to proceed.