A solution -- tracking down dogs the way cops track down murderers.
Apartment managers start by sending in a DNA sample from every dog in the complex, usually on a swab that has been swiped in the dog's mouth. The DNA is recorded on a PooPrints registry.
Then, when an errant stool is discovered, a sample is sent in and matched with the DNA in the database. The renegade pooch and owner are identified.