This was narrated from the Prophet ﷺ with this same report. Mahmud bin Labeed lived during the Prophet's ﷺ time, and Mahmud bin Rabi saw the Prophet ﷺ. Both of them were young boys from Madinah.
وقد روي عن النبي ﷺ أنه قال من بنى لله مسجدا صغيرا كان أو كبيرا بنى الله له بيتا في الجنة حدثنا بذلك قتيبة حدثنا نوح بن قيس عن عبد الرحمن مولى قيس عن زياد النميري
عن النبي ﷺ بهذا. ومحمود بن لبيد قد أدرك النبي ﷺ، ومحمود بن الربيع قد رأى النبي ﷺ، وهما غلامان صغيران مدنيان.
No references are available.
[Its chain of transmission is daif] Abdul-Rahman is majhul (unknown), and Ziyad is daif, as stated in Taqrib* and elsewhere.