Can a bishop excommunicate a retired bishop? Of course, we suppose that the retired bishop is living in the diocese where the new bishop came.
Only the Pope can excommunicate bishops because only he has jurisdiction over them.
Excommunication is an act of ecclesiastical jurisdiction, the rules of which it follows. Hence the general principle: whoever has jurisdiction in the forum externum, properly so called, can excommunicate, but only his own subjects. Therefore, whether excommunications be a jure (by the law) or ab homine (under form of sentence or precept), they may come from the pope alone or a general council for the entire Church; from the provincial council for an ecclesiastical province; from the bishop for his diocese; from the prelate nullius for quasi-diocesan territories; and from regular prelates for religious orders. Moreover, anyone can excommunicate who, by virtue of his office, even when delegated, has contentious jurisdiction in the forum externum; for instance, papal legates, vicars capitular, and vicars-general. But a parish priest cannot inflict this penalty nor even declare that it is incurred, i.e. he cannot do so in an official and judicial manner. The subjects of these various authorities are those who come under their jurisdiction chiefly on account of domicile or quasi-domicile in their territory; then by reason of the offence committed while on such territory; and finally by reason of personal right, as in the case of regulars.
It makes no difference where the retired bishop lives. A retired bishop doesn't suddenly become subject to the diocese's new bishop. He remains subject directly to the Pope. A bishop cannot lose his episcopal consecration.
Also, retired bishops are titular bishops, even if they remain residents of their same diocese:
1983 Can. 376 Bishops to whom the care of some diocese is entrusted are called diocesan; others are called titular.
Can. 402 §1. A bishop whose resignation from office has been accepted retains the title of emeritus of his diocese and can retain a place of residence in that diocese if he so desires, unless in certain cases the Apostolic See provides otherwise because of special circumstances.