I think it's a common folk belief. I don't know if it has any scriptural basis or perhaps basis in old tradition.
Or any history in Judaism?
Maybe a conflation of the beliefs in saints? (Catholic and Orthodox)
This is what Baha'u'llah offered
"..Thou hast, moreover, asked Me concerning the state of the soul after its separation from the body. Know thou, of a truth, that if the soul of man hath walked in the ways of God, it will, assuredly, return and be gathered to the glory of the Beloved. By the righteousness of God! It shall attain a station such as no pen can depict, or tongue describe. The soul that hath remained faithful to the Cause of God, and stood unwaveringly firm in His Path shall, after his ascension, be possessed of such power that all the worlds which the Almighty hath created can benefit through him. Such a soul provideth, at the bidding of the Ideal King and Divine Educator, the pure leaven that leaveneth the world of being, and furnisheth the power through which the arts and wonders of the world are made manifest. Consider how meal needeth leaven to be leavened with. Those souls that are the symbols of detachment are the leaven of the world. Meditate on this, and be of the thankful." –
Baha’u’llah,
Gleanings from the Writings of Baha’u’llah, p. 161.
Abdul'baha elaborated on this theme of spiritual influences and inspiration from the next world when he answered the question: “How should one look forward to death?”
"How does one look forward to the goal of any journey? With hope and with expectation. It is even so with the end of this earthly journey. In the next world, man will find himself freed from many of the disabilities under which he now suffers. Those who have passed on through death, have a sphere of their own. It is not removed from ours; their work, the work of the Kingdom, is ours; but it is sanctified from what we call time and place. Time with us is measured by the sun. When there is no more sunrise, and no more sunset, that kind of time does not exist for man. Those who have ascended have different attributes from those who are still on earth, yet there is no real separation.
In prayer there is a mingling of station, a mingling of condition. Pray for them as they pray for you! When you do not know it, and are in a receptive attitude, they are able to make suggestions to you, if you are in difficulty. This sometimes happens in sleep." – Abdu’l-Baha, Abdu’l-Baha in London, pp. 95–96.
Regards Tony