
Here are some helpful comments from Gordon H. Clark which answer the question of how one can know good works from evil ones. Emphasis in bold is my own.
What then are good works? Are they those actions a benevolently intentioned gentleman may happen to enjoy? Is a substantial donation to an orphanage, hospital, or church a good work? Strange as it may seem to non-Christians, and even to uninstructed Christians, the answer is that these actions are not necessarily good. They may be good; but again they may not be. What then makes a work or action good?
Two requirements must be fulfilled before an act can properly be called good. The [Westminster] Confession says, “Good works are only such as God hath commanded in his holy word, and not such as, without the warrant thereof, are devised by men out of blind zeal, or upon any pretense of good intention.”
The first part of this section teaches that unless we had the Bible, it would be impossible to know what is good and what is evil. To be sure, the heathen know that there is a distinction between right and wrong; and they regularly violate their consciences; but they do not know in particular what acts are right because their consciences are unenlightened. The Biblical revelation is essential to a knowledge of what works are good (“Good Works,” Essays on Ethics and Politics, p. 104; originally published in The Southern Presbyterian Journal, February 9, 1955.).