Both. Lincoln lifted it from 12:22 Matthew. He was a voluminous quoter of scripture for an infidel. But his close friends publicly defended him against accusations that he had been a believer despite modern illusions.
Matthew 12:22 "Then was brought unto him one possessed with a devil, blind, and dumb: and he healed him, insomuch that the blind and dumb both spake and saw."
If Lincoln said he lifted his "house divided" line from Matthew 22 then he was an infidel. Fortunately he was neither.