Newton refers to Locke's An Essay Concerning Human Understanding. In the essay, (Chapter IV:11 here) Locke reflects on the relationship between objects as encountered by the senses and words used to name or describe those objects. He argues that words alone cannot create an accurate idea of an object in the mind. Only when an object has been seen, heard or handled as the case may be can words be meaningfully used to define the object encountered. We can only say that an object is "red" because our eyes are able to distinguish colours that exist in the real world. The word "red" on its own would signify nothing apart from our being able to see objects of that colour.
This is where Newton's Lockean illustration comes in. Locke is out to demonstrate that the word "scarlet" has no meaning for a blind man, who is unable to perceive objects of that colour with his darkened eyes,
A studious blind man, who had mightily beat his head about visible objects, and made use of the explication of his books and friends, to understand those names of light and colours which often came in his way, bragged one day, That he now understood what scarlet signified. Upon which, his friend demanding what scarlet was? The blind man answered, It was like the sound of a trumpet. Just such an understanding of the name of any other simple idea will he have, who hopes to get it only from a definition, or other words made use of to explain it
Now, the blind man was very close. Brilliantly perceptive in fact. We often speak of red as a "loud" or "blaring" colour, using sound to describe what the eye alone can see. If scarlet had a sound, it would be the sound of a trumpet. But Locke was right, the redness of red, its bold, postbox brightness cannot in fact be perceived or understood by a blind man.
Newton's intention, however is not to discuss the finer points of empirical philosophy. His point is this, "Nor can all the learning and study in the world enable any person to form a suitable judgement of divine truth, till the eyes of the mind are opened". One may have a knowledge of the Bible, but without the spiritual enlightenment that comes with the new birth there is no true perception of the power, grace and beauty of Jesus Christ. John Newton knew what he was talking about,
I once was lost but now am found,
Was blind, but now I see.