The Cay was published in 1969, during the height of the American Civil Rights Movement and one year after the assassination of the Reverend Martin Luther King, Jr. Although you do not specify which of Dr. King's speeches you would like to compare with The Cay, I am assuming that you are referring to arguably his most famous one, "I Have a Dream."
There is a line in the "I Have a Dream" speech that clearly sums up the central theme of The Cay. In this line, Dr. King describes a world where all men
"will not be judged by the color of their skin but by the content of their character."
This is the concept that Phillip has such a hard time learning when he is first marooned with Timothy, and which, once he learns it, changes his life forever.
Phillip had been raised in Virginia, and had been much influenced by his mother's attitude towards Negroes. She has told him,
"They are not the same as you...they are different and they live differently.
Because he has been brought up to feel superior to and separate from Negroes, Phillip at first is repulsed by Timothy, thinking he is "black and ugly," and he refuses to accord him the respectful title of "mister," because even though he is an adult, "he [is] black."
When Phillip is blinded and realizes the many generous kindnesses Timothy extends towards him so that he might survive, he begins to perceive Timothy for the person he is rather than the color of his skin. At one point he tells Timothy that his mother "didn't like black people and ask[s] him why,' and Timothy responds sagely about the foolishness of prejudice, "I don' like some white people my own self, but 'twould be outrageous if I didn' like any o' dem." Timothy understands the truth that Dr. King dreamed about so many years later, that
"beneath d'skin is all d'same."
Phillip is able to overcome his tendency to judge Timothy and people in general by the color of their skin by being forced to depend upon Timothy, a man of great character. Though he had at first thought Timothy was "black and ugly," he now "[does] not seem ugly at all...only kind and strong." Deprived of his sight, Phillip can do nothing more that judge Timothy by the "strength of his character," and, in a whimsical moment that speaks with great depth, he asks Timothy,
"Are you still black?"