Frankly I cannot follow what are you doing. Where did you use the pigeonhole principle?
If we know that and is injective, then think of the points in Y as pigeonholes into which each goes for each . What would it mean if there were one hole empty?
No empty holes mean that is surjective.
Now can you turn the whole thing around?
Here is a big theorem from set theory.
The function is an injection if and only if there exist that is a surjrction.
You do see how that applies here?