The Power of Prayers
I heard this story the first time in one of the lectures by Br Khalil Jaffer in the series The Art of Yearning for God. I also read it in a book of Sufi stories.
One of the lessons to learn in this story is that we if recite the Names of God, it should be done with our hearts so that it takes effect. There is little benefit if we just recite it with our tongues while our heart is somewhere else.