Imam al-Shafi'i (may Allah have mercy on him) said: "Her 'uqr (that is, the compensation for having intercourse with her, the customary dower) will be taken from him, and there will be no hadd punishment on him, because of the doubt that he owns some share in her (due to his partnership in the booty)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / Q18294
Sayyidah Aishah (may Allah be pleased with her) says that the Messenger of Allah (peace and blessings be upon him) said: "Avert the hadd punishments as far as you are able. If you find a way out for the Muslims, then let them go, for it is better for the ruler to err in pardoning than to err in punishing."
The most authentic of the narrations on this from the Companions is the narration of Asim, from Abu Wa'il, from Abdullah bin Mas'ud, as his own statement.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18294
Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) said concerning a slave woman jointly owned by two men, one of whom had intercourse with her: "He is a betrayer of trust; do not impose the hadd punishment on him, rather her value is to be charged to him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18295
Umayr bin Numayr says that Ibn Umar (may Allah be pleased with them both) was asked about a slave woman jointly owned by two men, one of whom has intercourse with her. He said: There is no hadd punishment on him; her value is to be charged to him and he takes her. (b) This may apply where she has become pregnant by him, and Allah knows best.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18296