Just then a man in their synagogue who was possessed by an evil spirit cried out, "What do you want with us, Jesus of Nazareth? Have you come to destroy us? I know who you are - the Holy One of God!"
This is how you can recognize the Spirit of God: Every spirit that acknowledges that Jesus Christ has come in the flesh is from God.
John explains elsewhere in his letter that those who are against Christ may falsely claim that they know and follow God (2:4, 2:9, 4:20) but where they truly stand is revealed by their actions (3:10). Thus verbal confession and belief are made complete by one's actions (3:18, 5:1-2).
Other responses (offsite)