It is narrated from Ibn Shihab that it reached him that the Messenger of Allah ﷺ said: "Give precedence to the Quraysh and do not put yourselves before them; learn from them and do not compete with them in knowledge, or do not teach them." Ibn Abi Fudayk is uncertain about these words.
Hadith Referenceمسند الإمام الشافعي / كتاب فضائل قريش وغيرهم وأبواب متفرقة / 1776
Hadith Takhrijاسناده ضعیف لارساله : اخرجه البيهقي في المعرفة السنن والآثار (1537)۔