If Y is compact, then so is Y x Y (by Tychonoff's Theorem). If Z x Z were homeomorphic to Y x Y, then it would also be compact. But if Z x Z were compact, then Z would also be compact since it would be a continuous image of a compact space. Since Z is not compact, the answer is No. (A similar argument works using connectivity in place of compactness.)