The identity follows from a direct integration by parts on $\mathbb{R}$. Write the left side as
\begin{align*}
\mathbb{E}[(X - \theta)g(X)] = \int_\mathbb{R} g(x)(x - \theta) \frac{e^{-(x-\theta)^2/2}}{\sqrt{2\pi}}\, dx.
\end{align*}
The key observation is that $(x - \theta) e^{-(x-\theta)^2/2} = -\frac{d}{dx} e^{-(x-\theta)^2/2}$, so
\begin{align*}
\mathbb{E}[(X - \theta)g(X)] = -\int_\mathbb{R} g(x) \frac{d}{dx}\left(\frac{e^{-(x-\theta)^2/2}}{\sqrt{2\pi}}\right)dx.
\end{align*}
Integrating by parts on $[-N, N]$ and letting $N \to \infty$: the boundary term is $-[g(x)\phi(x-\theta)]_{-N}^{N}$, which vanishes as $N \to \infty$ because $g$ is bounded and $e^{-x^2}$ decays to zero. The remaining integral gives $\int_\mathbb{R} g'(x) \phi(x - \theta)\,dx = \mathbb{E}[g'(X)]$.