Elijah knew of the covetous act of Gehazi because he went with him in spirit. After Elisha had healed Naaman of his leprosy, Naaman offered Elisha gifts, which Elisha refused. However, Gehazi, Elisha's servant, coveted the gifts and secretly went after Naaman to ask for them. Naaman gave Gehazi the gifts, but when Gehazi returned to Elisha, Elisha knew of his servant's actions. Although Elijah was not physically present when this happened, he knew about it because he was a prophet and was able to perceive it through the Spirit of God.