This is a lie against Alī, may Allah be pleased with him. He never narrated it, and its falsity is evident for several reasons(1).
Ahmad narrated this hadith in al-Fadā’il (Virtues)(2): Uthmān(3) narrated to us; Abū Awānah narrated to us, from Uthmān ibn al-Mughīrah, from Abū Sādiq, from Rabīah ibn Nājiz, from Alī. These narrators are known(4) to transmit false reports.
Abū al-Faraj(5) also narrated through al-Ajlah, from Salamah(6) ibn Kuhayl, from Habbah ibn Juwayn(7), who said: “I heard Alī say, ‘I(8) worshipped Allah, Mighty and Majestic, alongside the Messenger of Allah, peace and blessings be upon him, five or seven years before any man of this ummah worshipped Him.’”
Abū al-Faraj said: “Habbah is not worth a grain(9), for he is a liar. Yahyā said, ‘He is of no account’(10). Al-Sa‘dī said, ‘He is unreliable.’ Ibn Hibbān said, ‘He was extreme in his Shiism and weak(11) in hadith.’ As for al-Ajlah, Ahmad said, ‘He narrated more than one rejected hadith.’ Abū Hātim al-Rāzī said, ‘He cannot be cited as evidence’(12), and Ibn Hibbān said, ‘He did not know what he was saying.’”