A question on Voisin's book I got stuck at some point in Voisin's book Hodge theory and complex algebraic geometry II. It is on page 58, proof of lemma 2.26:

Let $X \subset \mathbb {CP}^{N}$ be a $n$-dimensional compact complex manifold, and $Y$ be a hyperplane section. Take any general hyperplane section $X_{\infty}$, set $B= Y\cap X_\infty$ and let $\tilde X$ be blow up of $X$ along the $B$. Then it claims
  $$ker(H_{n-1}(Y)\to H_{n-1}(X))=ker(H_{n-1}(Y)\to H_{n-1}(\tilde X-X_\infty))$$

I want to know why this is true?
(On the book it says this followes from corollary 2.23 but I didn't see how)
My attempt
Since there is a map
$$\tilde X-X_\infty \hookrightarrow \tilde X \to X$$
we expect the composition induces the map on cohomology to be injective.
Meanwhile, corollary 2.23 says
$$H_{n-1}(\tilde X-X_\infty) \to H_{n-1}(\tilde X)$$
is injective. So only need to show the other map is injective. However, this seems not true. For instance, we can take $X=\mathbb{CP^3}$ and $\tilde X$ is blow up $\mathbb {CP^3}$ along a line. Then the blow down map will contract some $S^2$, hence the induced map on $H_2$ cannot be injective.
 A: Lemma: If a homology class $\alpha$ in $H_{n-1}(\widetilde{X})$ is has a representative supported on the exceptional divisor, then it's image is $0$ in $H_{n-1}(X)$ under the map induced by the blow-down. Furthermore, this is an equivalence: any class sent to $0$ under the map induced by the blow-down $Bl:\widetilde{X}\to X$ is has a representative contained in the exceptional divisor.
Proof: Suppose $\alpha$ has a representative supported on the exceptional divisor. Then the image of this representative is contained in a smaller-dimensional subvariety, and thus represents $0$ in $H_{n-1}(X)$. To show that this statement is an equivalence, suppose that $\beta\neq 0 \in H_{n-1}(\widetilde{X})$ does not have a representative supported on the exceptional divisor. Then $Bl_*(\beta)$ cannot have any representative contained in the closed subvariety we are blowing up, and therefore if $\beta$ was nonzero in $H_{n-1}(\widetilde{X})$, it must be nonzero in $H_{n-1}(X)$.
In particular, this shows that any nonzero class in the image of $H_{n-1}(\widetilde{X}-X_\infty)\hookrightarrow H_{n-1}(\widetilde{X})$ cannot be sent to $0$ under the composite map: any such class cannot have a representative contained in the exceptional divisor. Therefore the composite map is injective, and combined with the work in your post, this proves the statement.
