Many perish only because they do not obey the Gospel, not because God elects them to perish. That would be absurd, unbiblical, and contrary to the Gospel: But they have not all obeyed the gospel. For Esaias saith, Lord, who hath believed our report? (Rom 10:16)
And the passage you quoted is about false professors, who do not know Christ internally and experientially, and are therefore not know of Him.
Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven. Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many wonderful works? And then will I profess unto them, I never knew you: depart from me, ye that work iniquity.
And what is the will of the Father? To believe on the Lord Jesus Christ and receive everlasting life: And this is the will of him that sent me, that every one which seeth the Son, and believeth on him, may have everlasting life: and I will raise him up at the last day. (John 6:40)