Yes, this is true, with the appropriate assumption that $M_1$ is irreducible (this is needed for Johansson and Waldhausen's statements),
and let's say orientable.

One may reduce to Waldhausen's theorem if we know that $f_{|\partial M_1}$ is homotopic to a homeomorphism $f'_{|\partial M_1}:\partial M_1\to \partial M_2$, by homotopy extension.

Consider the image surface $f(\partial M_1) \subset M_2$ (assume this embedding is transverse, so doesn't meet $\partial M_2$). Since $\partial M_1$ is homologically trivial in $M_1$, $f(\partial M_1)$ is homologically trivial in $M_2$, hence bounds a submanifold $M \subset M_2$. Then $\partial M =f(\partial M_1)$ is homotopic to $\partial M_2$ iff $M_2-M$ is a product manifold (this follows from a result of Waldhausen, see Corollary 5.5 of

*Friedhelm Waldhausen*, MR 224099 **On irreducible $3$-manifolds which are sufficiently large**, *Ann. of Math. (2)* **87** (1968), 56--88.).

Take a homotopy inverse $g:M_2\to M_1$ to $f$. Then $g_{|M}$ is $\pi_1$-injective, and we may homotope $g$ so that $g_{|\partial M}\to \partial M_1$ is a homeomorphism. This map is also degree one, and $\pi_1$-injective, hence a homotopy equivalence. But this implies that $\pi_1M\to \pi_1 M_2$ is an isomorphism. In turn, this implies that $M_2-M$ is a product.

(I'm leaving out many details here, and I don't mean to give a proof by intimidation, so let me know if you would like to have any details on steps of this argument.)

As a reality check, the standard example of a homotopy equivalence which is not a homeomorphism is obtained by permuting the pages of a book of $I$-bundles. But the boundary of one will immerse in the other, and hence will not satisfy your hypothesis.