The risk neutral probability measure $Q$ is the true probability measure $P$ times the stochastic discount factor $M$ but rescaled so $Q$ sums to 1.
Simple derivation
For maximum simplicity, I'll work in a discrete probability space with $n$ possible outcomes. Everything goes through under measure theory in more general, infinite number of outcome probability spaces.
Let $\mathbf{x}$ be a vector denoting cashflows in those $n$ states. Let $\mathbf{p}$ be a vector denoting the probabilities of those $n$ states. Let $\mathbf{m}$ be a vector denoting the stochastic discount factor.
If a stochastic discount factor $\mathbf{m}$ exists, today's price of the future cashflow $\mathbf{x}$ is given by:
$$ f(\mathbf{x}) = \sum_{i=1}^n p_i m_i x_i $$$$ f(\mathbf{x}) = \sum_{i=1}^n p_i m_i x_i $$
The basic idea behind risk neutral probabilities is to rescale $p_im_i$ and call it $q_i$. (Note $p_im_i$ is today's price for a cashflow of 1 in state $i$, a type of contingent claim known as an Arrow security). Now defineDefine vector $\mathbf{q}$ as: $$ q_i = \frac{p_i m_i}{\sum_{j=1}^n p_j m_j}$$
Observe that $\mathbf{q}$ is also a probability vector since $\sum_i q_i = 1$. It's a vector of state prices rescaled so that $\mathbf{q}$ is a probability vector. Also note that risk free rate must satisfy $1 = \sum_i p_i m_i r$. Hence risk free rate $r = \frac{1}{\sum_i p_i m_i}$. Then: \begin{align*} f(\mathbf{x}) &= \sum_i \underbrace{p_i m_i}_{=\frac{q_i}{ r}} x_i \\ &= \frac{1}{r}\sum_i q_i x_i \end{align*}
Today's price of cashflow $\mathbf{x}$ is given by the expectation of $\mathbf{x}$ under the probability measure $\mathbf{q}$ discounted by the risk free rate.
The same logic goes through under measure theory (but you have a bit more formal mathematics with a Radon-Nikodym derivative etc...).
$$ \mathbb{E}^P[MX] = \frac{1}{r} \mathbb{E}^Q[X] \quad \quad \frac{dQ}{dP} = r M \quad \quad r = \frac{1}{\mathbb{E}^P[M]}$$
The whole idea of risk neutral pricing is actually incredibly simple: throw the stochastic discount factor into the probability measure.