"Elijah's prayer was answered. Oft-repeated appeals, remonstrances, and warnings had failed to bring Israel to repentance. The time had come when God must speak to them by means of judgments. Inasmuch as the worshipers of Baal claimed that the treasures of heaven, the dew and the rain, came not from Jehovah, but from the ruling forces of nature, and that it was through the creative energy of the sun that the earth was enriched and made to bring forth abundantly, the curse of God was to rest heavily upon the polluted land. The apostate tribes of Israel were to be shown the folly of trusting to the power of Baal for temporal blessings. Until they should turn to God with repentance, and acknowledge Him as the source of all blessing, there should fall upon the land neither dew nor rain. PK 120.1"
"And Elijah the Tishbite, who was of the inhabitants of Gilead, said unto Ahab, As the Lord God of Israel liveth, before whom I stand, there shall not be dew nor rain these years, but according to my word."
EGW elaborates on the context and reason for the drought announced in 1 Kings 17:1, creating a thematic parallel. While not a direct quote, the passage clearly builds upon the biblical narrative.
"Elias was a man subject to like passions as we are, and he prayed earnestly that it might not rain: and it rained not on the earth by the space of three years and six months."
While James 5:17 mentions Elijah's prayer and the resulting drought, the EGW passage provides the theological context and reasoning behind the drought as a judgment from God due to Israel's apostasy and Baal worship. It expands on the thematic elements of divine judgment and repentance related to Elijah's actions.
"To Elijah was entrusted the mission of delivering to Ahab Heaven's message of judgment. He did not seek to be the Lord's messenger; the word of the Lord came to him. And jealous for the honor of God's cause, he did not hesitate to obey the divine summons, though to obey seemed to invite swift destruction at the hand of the wicked king. The prophet set out at once and traveled night and day until he reached Samaria. At the palace he solicited no admission, nor waited to be formally announced. Clad in the coarse garments usually worn by the prophets of that time, he passed the guards, apparently unnoticed, and stood for a moment before the astonished king. PK 120.2"
"And Elijah the Tishbite, who was of the inhabitants of Gilead, said unto Ahab, As the Lord God of Israel liveth, before whom I stand, there shall not be dew nor rain these years, but according to my word."
EGW describes the events surrounding Elijah's appearance before Ahab in 1 Kings 17:1. While not a direct quote, it's a clear retelling and interpretation of the same event.