How about $Y=\{(x,y)\in \mathbb{R}^2| x^2+y^2<1\}\setminus \{0\}\times(0,1)$ and $X=\{(x,y)\in \mathbb R^2\,|\, x^2+y^2=1\}$. Where $X_1=\{(0,1)\}$ and $X_2=X\setminus X_1$ with the map $f:Y\rightarrow X$ defined by $f(x,y)=(\cos(2\pi (x^2+y^2)),\sin(2\pi (x^2+y^2))$.
The map $f$ does not induce an isomorphism in homology. The fiber over every point in $X_2$ is an open interval (a circle minus a point) and the fiber over $X_1$ is a point. As both $X_1$ and $X_2$ are contractible the map does induce isomorphisms when restricted to $f^{-1}(X_1)$ and $f^{-1}(X_2)$ respectively.