According to the definition of acids, for Bronsted-Lowry, an acid is any species that can donate a proton, which is H+, to another molecule, and a base is any species that is capable of accepting a proton. Therefore, according to this definition, we have the following reaction:
H2Y- + H2Z- <---> H3Y + HZ^2-
In this reaction, we can see that H2Z donated a H+ to H2Y, therefore H2Z is the acid on the reactants side, and H2Y will be the base.
On the products side, since we have a reversible reaction, H3Y will donate a H to HZ^-2, therefore H3Y will be the acid, and HZ^-2 will be the base