measure theory – $sigma$-algebra generated by a function having as target a Borel space

Let $X, Y$ be sets, $f:X rightarrow Y$ be a function and suppose we have a set of subsets of $Y$, $tau$; unless the answer to my question requires it, I think $tau$ can be arbitrary, not necessarily a topology.

Let $H : = sigma({ f^{-1}(U): U in tau })$ and $G := left{ f^{-1}(M): M in sigma(tau) right}$. Is it true that $H = G$?

I can see that $H subseteq G$ because ${f^{-1}(M): Min sigma(tau) }$ is a $sigma$-algebra by set theoretic stuff, which contains ${ f^{-1}(U): U in tau }$.

But I can’t find an argument for the converse inclusion. If I take $G’$ another $sigma$-algebra containing ${ f^{-1}(U): U in tau }$, can I show that $G subseteq G’$? Probably yes, exploiting that $sigma(tau)$ is smallest, but I can’t see how.