The quote cited below is from the damnable heretic Jonathan Edwards’ Miscellanies (some paragraphing mine; caps are original at the Jonathan Edwards Center  at Yale University website). Miscellany 1162 has been described as the most cryptic. Some writers have described Edwards’ comments here as “hesitant and tentative” and “somewhat ambivalent.” Also that a “curious tension” is found in Edwards’ thinking (e.g., some statements by Edwards regarding the state of the heathen are explicitly and clearly negative, while the comments in Miscellany 1162 are less so).
1162. It may be worthy of consideration whether or no some of the HEATHEN PHILOSOPHERS had not, with regard to some things, some degree of INSPIRATION of the Spirit of God, which led ’em [sic] to say such wonderful things concerning the Trinity, the Messiah, etc. Inspiration is not so high an honor and privilege as some are ready to think. It is no peculiar privilege of God’s special favorites. Many very bad men have been the subjects of it, yea, some that were idolaters. Balaam was an idolater and a great sorcerer or wizard, and yet he was the subject of inspiration, and that even when in the practice of his witchcraft, when he went to seek by enchantment. Yea, the devils themselves seem sometimes to have been immediately actuated by God and forced to speak the truth in honor to Christ and his religion. So the devil at the oracle of Delphos was probably actuated by God, and compelled to confess Christ, and own that the Hebrew child had to be above him, and had sent him to hell and forbidden him to give forth any more oracles.7
Why might not Socrates and Plato and some others of the wise men of Greece have some degree of inspiration, as well as the wise men from the East who came to see Christ when an infant? Those wise men dwelt among the heathen as much as the wise men of Greece, and were in like manner Gentiles born of heathen and brought up among them, and we have no reason to think that they were themselves less of heathen than several of the Grecian philosophers, at least before they were the subjects of that inspiration that moved them to follow the star that led them to Christ.
Pharaoh and his chief butler and baker were the subjects of a sort of inspiration in the dreams they had, for ’tis evident those dreams were divine revelations. And [so] were Nebuchadnezzar’s dreams. He, though a heathen and very wicked man and great idolater, yet had a revelation concerning Messiah and his future kingdom in his dream of the great image and the stone cut out of the mountains without hands.
If it be objected that, if we suppose some of the heathen philosophers to have truths suggested to ’em by the inspiration of the Spirit of God, we must suppose that God gave these revelations without giving with them any certain evidences by which others to whom they declared them might determine them to be such, or by which they might be obliged to regard and receive them as such: allowing this to be the case, yet a good end might be answered in giving these revelations nevertheless. Though they could be no rule to the heathen among whom they lived, yet they might be of use these three ways:
(1) they might dispose the heathen nations, as they had occasion to converse with the Jews and to be informed of the revelations and prophecies that they had among them, to attend the more to them and to inquire into them and their evidences;
(2) they might prepare the Gentile nations, that had among them the records of these sayings of their most noted and famous wise men, to receive the gospel when God’s time came for its promulgation among these nations, by disposing them the more diligently and impartially to attend to it;
(3) they may be of great benefit to the Christian church ages after they were delivered, as they serve as a confirmation of the great truths of Christianity;
(4) we know not what evidence God might give to the men themselves that were the subjects of these inspirations that they were divine and were true (as we know not what evidence was given to the wise men of the East of the divinity of their revelations). And so we know not of how great benefit the truths suggested might be to their own souls.
7. On the source of this reference, see Works, 18, 508, n. 3 [SOURCE for this quote]
 I contacted the Jonathan Edwards Center at Yale University regarding their stated copyright information and quoting from the online Volume 23 of The Miscellanies. Here is how the Edwards Center at Yale responded:
Thank you for contacting the Edwards Center. If you make use of Misc 1162 please acknowledge the source in accordance with reference citation guidelines