It was Illinois, Indiana, and Pennsylvania that the Republicans hoped to gain. That would give Lincoln the majority. And as you can see, Lincoln won those states as well as California, Minnesota , and Oregon.
But it still wasn't easy. No Southern state voted for Lincoln, he wasn't even on the ballot in most of those states. And if the Democratic party has not split and nominated Northern and Southern candidates (Douglas and Breckenridge)--the contest might have been even closer.
But instead of accepting their democratic fate, the Southerners decided to leave the Union. This is what the president-elect would have to deal with in March 1861 at his inauguration.