The book had not even been published at the time. Dick wrote it in 1962, it was serialized in 1969 and published in book form in 1972 so it could not have influenced Disney at all.
I would though think that this Star Trek episode must have been informed by Disney's Lincoln
even if there is no explict connection drawn (everybody knew about Disney's Lincoln then, it was talked about a lot) It is mentioned specifically in the 1967 film
where the protagonists are being lectured to by an animatronic figure and once character says "He's like Abe Lincoln" so there is some expectation at that time that people would know about him.
I would though think that this Star Trek episode must have been informed by Disney's Lincoln
https://en.wikipedia.org/wiki/The_Savage_Curtain
even if there is no explict connection drawn (everybody knew about Disney's Lincoln then, it was talked about a lot) It is mentioned specifically in the 1967 film
https://en.wikipedia.org/wiki/The_President%27s_Analyst
where the protagonists are being lectured to by an animatronic figure and once character says "He's like Abe Lincoln" so there is some expectation at that time that people would know about him.