A question like this can really be said to be one of the most controversial questions in STEM. A person attempting to answer risks through that mere attempt to deposit a certain message about their worldview into the world, one which can be sanctioned or worse. By this I mean being called out for overclaiming the weight of IQ relative to other factors (I'll come to this later.)
On one hand you have the slippery definition of IQ and intelligence and on the other you have a slippery definition on what it means to be successful in STEM. At this point speaking about definitions and independent truths becomes folly thus I will respond with a personal opinion in the vain hope that this forum supports what one might call "free speech". This opinion may be wrong or misguided so I offer it as a hypothesis only.
IQ is not intelligence but it is the best correlate to intelligence we have ever had. Meaning you'd be hard pressed to find an individual with a gifted IQ whom you might colloquially judge as dumb and certainly not in matters pertaining to STEM. IQ enables one to grasp concepts faster, assimilate them deeper and perceive structural parallels that remain opaque to others regardless of effort or access to information. One cannot become an Einstein or Newton through effort, else anyone could be them. That much is trivial to observe. But: for 99% of STEM careers the question is not if one can be Newton or whatever. What I believe that most researchers aspire to is being productive while doing what they love. And for this the data is clear: an average IQ and high enthusiasm and persistence are more than sufficient for this purpose.
Now I will attempt to illustrate my point with an example from matrix progressions.
A visual matrix is in essence a carefully arranged presentation of facts about the world which have a certain simple interdependence. For example, if from box 1 to box 2 an object changes colour another object will change coordinates and so on, whatever, the specifics don't matter. What matters is that when you first encounter the matrix progression you do not know what the underlying rule is. You need to compare and observe facts about the world in order to extract some general principle that governs them. However, even here, matrix tests measure inductive reasoning in a closed system. Real STEM problems are open-ended: you often don't know which variables matter and you have to infer patterns from noisy, incomplete data. That requires creativity, domain knowledge and tolerance for ambiguity but in my view, creativity is not easily separable from IQ; it is what high IQ looks like when applied to novel problems, which is why psychometrics introduced the latent variable g. The ability to generate hypotheses, see analogies and restructure a problem is the same fluid intelligence that matrix tests measure just in a messier context. These traits are not perfectly captured by a single test score but they are expressions of the same underlying capacity (g).
If a person is incapable of quickly extracting a simple rule from a constrained environment how are they going to be capable of extracting underlying rules from the world when the world is imbued with staggering complexity? In my opinion academia has solved this issue through collaborative effort: the world's complexity is tackled collectively not individually. A researcher with average-plus IQ but excellent collaboration skills can outpace a solitary 140 IQ genius in most modern STEM fields simply because science is now a team sport. So the real threshold may be lower than the mythology suggests: once you're above ~115, other traits, such as enthusiasm and persistence, start mattering more.
Hence I would return to your original question. Do IQ and STEM correlate? Depends on what you wish to achieve. If your desire is to simply learn about the world, then it doesn’t matter at all. But if your desire is to leave a lasting impact on the field or discover something not previously known then unfortunately IQ places a very strict cap on who is actually likely to achieve it. This does not mean IQ should determine who is encouraged to attempt and I am against any psychometric assessment when it comes to college enrolment criteria. Lastly, the very fact that this question keeps cropping up in STEM ever since psychometric assessment was even designed demonstrates that perhaps we all intuitively feel these differences without being able to formally prove them. This is not to say that they should govern our policies or behaviour, or encourage the discrimination of anybody, including high IQ individuals who do believe that it makes a difference.