I think I found a counterexample of which I am sure that the monoids we started with are as nice as we could wish for: Start with the cofibration $\imath\colon 1\to \mathbb{N}$. We will show that $\mathrm{id}_{\mathbb{N}}\times\imath\colon \mathbb{N}\to \mathbb{N}\times \mathbb{N}, p\mapsto (p,0)$ is not a cofibration.
Consider the topological group $G:=\mathbb{R}^3$ with $(a,b,c)\cdot (a',b',c')=(a+a',b+b',c+c'+ab')$. Then the free path space $G^I$ is again a topological group by pointwise multiplication, and the evaluation $\varepsilon\colon G^I\to G, \alpha\mapsto \alpha(0)$ is an acyclic fibration since its underlying map of spaces is one.
Now consider $f\colon \mathbb{N}\times\mathbb{N}\to G,(p,q)\mapsto (0,q,0)$ which is clearly a homomorphism of topological monoids, and consider $h:\mathbb{N}\to G^I$ defined by $h(p)(t)=(tp,0,0)$. Note that the corresponding square commutes, i.e. we have $(\varepsilon\circ h)(p) = (0,0,0)=f(p,0)=(f\circ (\mathrm{id}\times\imath))(p)$.
However, there is no lift: Note that a homomorphism $H\colon \mathbb{N}\times\mathbb{N}\to G^I$ is the same as a choice of paths $\alpha=H(1,0)$ and $\beta=H(0,1)$ such that $\alpha\cdot\beta=\beta\cdot\alpha$ holds pointwise. The commutativity of the two triangles then implies that $\alpha=h(1)$ and $\beta(0)=(0,1,0)$. However, continuity of $\beta$ implies that there is a $t>0$ and a $s>0$ as well as $x,y\in\mathbb{R}$ such that $\beta(t)=(x,s,y)$, which gives
$$\alpha(t)\cdot\beta(t)=(t,0,0)\cdot (x,s,y)\ne (x,s,y)\cdot (t,0,0)=\beta(t)\cdot \alpha(t).$$