It doesn't not hold in general, and I don't know of any nice criteria for which it does hold.
For example, if $X = T^2$, $Y = S^2$, and $f:X\rightarrow Y$ collapses the $1$-skeleton to a point, then $f^\ast$ is injective. However, since each component of $\Omega S^1$ is contractible, it follows that each component of $\Omega T^2$ is contractible. Since $\Omega S^2$ has unbounded cohomology (which can be found, for example, in Hatcher's spectral sequences book), there is no way the induced map $H^\ast(\Omega S^2)\rightarrow H^\ast(\Omega T^2)$ is injective.
If you are like me, you prefer simply connected spaces, and geometrically nice maps. Even with this preference, there are counterexamples.
To see this, let $X = \mathbb{C}P^3$ and $Y = S^4$, and let $f:X\rightarrow Y$ be obtained as follows. First, identity $\mathbb{C}^4$ and $\mathbb{H}^2$. Then each complex line $L$ in $\mathbb{C}^4$ (that is, each point in $X$) can be completed to a quaternionic line $L$ via $L\mapsto L\cup jL$. This gives a map $\mathbb{C}P^3\rightarrow \mathbb{H}P^1$. Identifying $\mathbb{H}P^1$ with $S^4$ then gives $f$.
This map is a fiber bundle map with fiber $S^2$. For my way of thinking, the easiest way to see this is to identify the whole picture with the homogeneous fibration $K/H\rightarrow G/H\rightarrow G/K$ where $H\subseteq K\subseteq G$ is $Sp(1)\times S^1\subseteq Sp(1)\times Sp(1)\subseteq Sp(2)$.
From the Gysin sequence/ Serre spectral sequence, it is now easy to see the map $f^\ast:H^4(S^4)\rightarrow H^4(\mathbb{C}P^3)$ is an isomorphism, so $f^\ast:H^\ast(Y)\rightarrow H^\ast(X)$ is injective.
On the other hand, $H^3(\Omega X;\mathbb{Q})$ is non-trivial, while $H^3(\Omega Y;\mathbb{Q})$ is trivial. Believing this for a moment, the induded map on integral cohomology $H^3(\Omega X)\rightarrow H^3(\Omega Y)$ cannot possibly be injective.
To compute $H^3(\Omega X;\mathbb{Q})$, one can use rational homotopy theory. Based loop spaces are known to be nilpotent, so the Sullivan minimal model machinery works just fine. Since $\pi_\ast(X)\otimes \mathbb{Q}$ is non-zero only when $\ast = 2,7$, it follows that $\pi_\ast(\Omega X)\otimes \mathbb{Q}$ is non-zero only when $\ast = 1,6$. From the minimal model, we know deduce that $H^\ast(\Omega X;\mathbb{Q})$ is non-trivial only in dimensions which are $0$ or $1$ mod $6$.
Best Answer
No, you can bend an open line $—$ into a figure eight $∞$ in a bijective and continuous way, so $f(—) = ∞$, but $π_1(—) = 1$, whereas $π_1(∞) ≠ 1$. See the figure at wiki/Immersed Submanifolds: