The gift of discernment is the ability to distinguish right from wrong, truth from error, and to give an immediate evaluation based on God’s Word. He can perceive whether a person’s actions arise out of Godly, satanic or human sources.
“From that time on Jesus began to explain to his disciples that he must go to Jerusalem and suffer many things at the hands of the elders, chief priests and teachers of the law, and that he must be killed and on the third day be raised to life. Peter took him aside and began to rebuke him. “Never, Lord!” he said. “This shall never happen to you!” Jesus turned and said to Peter, “Get behind me, Satan! You are a stumbling block to me; you do not have in mind the things of God, but the things of men” (Matthew 16:21–23).
See also 1 John 4:1-6