Hilchos Rechilus, chapter 9, section 14

If something improper was done to Reuven and he does not know who did it, and he asks Shimon: “Who did this to me?” Even if one sees that Reuven suspects him of doing it, he should not identify the perpetrator even if he saw the incident himself. He should rather answer: “I did not do it.” This does not apply if was something one should inform him of even if he did not suspect one of being the perpetrator such as when the conditions discussed before are fulfilled, as we wrote in paragraph 7 and as is explained above in volume 1 chapter 10 paragraph 17 regarding lashon hara. Look there carefully because all the rationales mentioned in the Mekor Hachaim and the Be’er Mayim Chaim regarding halachah or fulfilling one’s obligation to heaven [beyond what halachah requires] are relevant here as well.