Mishkat al-Masabih 3381
Hilal b. Usama quoted Abu Maimuna Sulaiman,* client of the people of Medina, as saying:
While I was sitting with Abu Huraira a Persian woman came, to him along with a son of hers. She had been divorced by her husband and they both claimed him. She addressed him in foreign speech telling him that her husband wished to take her son away, and Abu Huraira told them to cast lots for him, saying that to her in foreign speech. Then her husband came and asked who was disputing with him about his son, and Abu Huraira assured him in God's name that the only reason why he said what he had said was because once when he was sitting with God’s Messenger a woman came to him and said, “Messenger of God, my husband wants to take away my son, and he had benefited me and drawn water for me from the well of Abu ‘Inaba.” (Nasa’i has “from sweet water.”) God’s Messenger replied, “Cast lots for him.” Her husband asked, “Who is disputing with me about my son?” and God’s Messenger said, “This is your father and this is your mother, so take whichever of them you wish by the hand,” and he took his mother’s hand. 
* Mirqat , iii, 536 says that while Sulaiman appears in all texts of the Mishkat , the correct form is Salman. Abu Dawud, Talaq , 35 (in the 2-vol. edn. Cairo, 1348 A.H.) has Salma (or Sulma). See further Ibn Hajar, Tahdhib , xii, 253.

Abu Dawud and Nasa’i transmitted it, but Nasa’i mentioned the version which was traced back to the Prophet. Darimi transmitted it on the authority of Hilal b. Usama.
عَنْ هِلَالِ بْنِ أُسَامَةَ عَنْ أَبِي مَيْمُونَةَ سُلَيْمَانَ مَوْلًى لِأَهْلِ الْمَدِينَةِ قَالَ: بَيْنَمَا أَنَا جَالِسٌ مَعَ أَبِي هُرَيْرَةَ جَاءَتْهُ امْرَأَةٌ فَارِسِيَّةٌ مَعَهَا ابْنٌ لَهَا وَقَدْ طَلَّقَهَا زَوْجُهَا فَادَّعَيَاهُ فَرَطَنَتْ لَهُ تَقُولُ: يَا أَبَا هُرَيْرَةَ زَوْجِي يُرِيدُ أَنْ يَذْهَبَ بِابْنِي. فَقَالَ أَبُو هُرَيْرَةَ: اسْتهمَا رَطَنَ لَهَا بِذَلِكَ. فَجَاءَ زَوْجُهَا وَقَالَ: مَنْ يُحَاقُّنِي فِي ابْنِي؟ فَقَالَ أَبُو هُرَيْرَةَ: اللَّهُمَّ إِنِّي لَا أَقُولُ هَذَا إِلَّا أَنِّي كُنْتُ قَاعِدًا مَعَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَأَتَتْهُ امْرَأَةٌ فَقَالَتْ: يَا رَسُولَ اللَّهِ إِنَّ زَوْجِي يُرِيدُ أَنْ يَذْهَبَ بِابْنِي وَقَدْ نَفَعَنِي وَسَقَانِي مِنْ بِئْرِ أَبِي عِنَبَةَ وَعِنْدَ النَّسَائِيِّ: مِنْ عَذْبِ الْمَاءُ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «اسْتَهِمَا عَلَيْهِ» . فَقَالَ زَوْجُهَا مَنْ يُحَاقُّنِي فِي وَلَدِي؟ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «هَذَا أَبُوكَ وَهَذِهِ أُمُّكَ فَخُذْ بِيَدِ أَيِّهِمَا شِئْتَ» فَأَخَذَ بيد أمه. رَوَاهُ أَبُو دَاوُد. وَالنَّسَائِيّ لكنه ذكر الْمسند. وَرَوَاهُ الدَّارمِيّ عَن هِلَال بن أُسَامَة