We obtain explicit solutions of certain systems of matrix equations which define commuting generalized inverses. It is proved that the only possible generalized inverse defined by (4) is the Drazin inverse. On the other hand, the system (18) defines the generalized inverses, which may differ from the Drazin inverse. Examples are given in order to show how the obtained results can be extended to associative rings.