For the forward implication, suppose Y is complete. You want to show it is closed.

Suppose that a sequence in Y converges in X. We will show that its limit belongs to Y.

This is somewhat obvious, since a convergent sequence is a Cauchy sequence, and all Cauchy sequences in Y converge in Y.

For the inverse implication, suppose Y is closed in X. We show that Y is complete.

Consider a Cauchy sequence in Y. Since this also belongs to X and X is a Banach space, the sequence converges.

But Y is closed in X, and so the limit of the sequence must belong to Y. This means Y is complete.

Note that the assumption that Y is a subspace is not necessary.