Yes, in general, the model $M[g]$ will have the same amount of iterability as $M$. To see this, we need the following lemma giving the necessary and sufficient condition for when an ultrapower of a generic extension is the lift of an ultrapower of the ground model.
Lemma: Suppose $M$ is a transitive model of ${\rm ZFC}^-$, $\mathbb P\in M$ is a poset and $G\subseteq \mathbb P$ is $M$-generic. Suppose further that $U\in M$ is an ultrafilter on a cardinal $\delta$ and $U^*\in M[G]$ is an ultrafilter on $\delta$ extending $U$, both with well-founded ultrapowers. Then the ultrapower by $U^*$ is a lift of the ultrapower by $U$ if and only if every $f:\delta\to M$ in $M[G]$ is $U^*$-equivalent to some $g:\delta\to M$ in $M$.
Let $\delta$ be the preimage of $\kappa$ under $\pi$ and let $M=M_0$. Let $j_{\xi\mu}:M_\xi\to M_\mu$ be the iterated ultrapowers of $M_0$ by $U'$. We can lift the entire iteration to the directed system consisting of $j_{\xi\mu}:M_\xi[g]\to M_\mu[g]$. So it suffices to argue that this is precisely the iteration of $M_0[g]$ by $U^*$, where $U^*$ is the ultrafilter extending $U'$ generated by using $\delta$ as a seed from the lift $j_{01}:M_0[g]\to M_1[g]$ (for $A\subseteq\delta$ in $M_0[g]$, we have $A\in U^*$ whenever $\delta\in j_{01}(A)$) . The embedding $j_{01}:M_0[g]\to M_1[g]$ is precisely the ultrapower by $U^*$. So, the conclusion for $j_{01}$ follows by the definition of $U^*$. Thus, $M_0[g]$ satisfies that "every new function from $\delta$ into $M$ is $U^*$-equivalent to an old function" by the lemma. But, then by elementarity $M_1[g]$ satisfies this for $j_{01}(U^*)$ and $M_1$, which means that the ultrapower of $M_1[g]$ by $j_{01}(U^*)$ is the lift of $j_{12}:M_1\to M_2$, namely $j_{12}:M_1[g]\to M_2[g]$ (lifts of small forcing extensions are unique). By elementarity, we can continue to propagate this statement along the entire iteration.
Indeed, the result is much more general. Even if $\mathbb Q$ is not small relative to $\delta$, but we are able to lift the first ultrapower $j_{01}:M_0\to M_1$ to $M_0[g]$, then every iterate by $U^*$ (obtained as before) will satisfy the "no new functions" statement and therefore it will be a lift of a ground model embedding and therefore well-founded. Thus, to lift the entire iteration, it suffices to lift the just the first step! Moreover, the lift of the iteration is the iteration of the lift. A more involved argument (and some more restrictions on the forcing) is needed in the case where the ultrafilter $U'$ is an $M$-ultrafilter that is external to $M$, because the statement whose elementarity we are using is not necessarily expressible in $M$ in that situation. This argument is given in my paper (with Arthur Apter and Joel Hamkins) Inner models with large cardinal features usually obtained by forcing.