Luke 9:49 And John answered and said, Master, we saw one casting out devils in thy name; and we forbad him, because he followeth not with us.
Luke 9:50 And Jesus said unto him, Forbid him not: for he that is not against us is for us.
This is an exception, to other scriptures on the subject. God always shows us something new. Who can know the mind of God? A scripture that supports this verse is:
Mat 12:25 And Jesus knew their thoughts, and said unto them, Every kingdom divided against itself is brought to desolation; and every city or house divided against itself shall not stand:
Mat 12:26 And if Satan cast out Satan, he is divided against himself; how shall then his kingdom stand?
But there are other scriptures that do not agree with this.
Mat 7:21 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.
Mat 7:22 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?
Mat 7:23 And then will I profess unto them, I never knew you: depart from me, ye that work iniquity.
What is different in this passage? Many claimed to prophesy, cast out devils in Jesus name and to do wonderful works, BUT, Jesus knew their hearts. They were phonies, not truly of God, but pretenders. Jesus examined their works, they did not do the will of the Father. They were doing things on their own, claiming to hear from the Father, claiming to do great things from the Father, it was all smoke, worthless. Why? Jesus said, "I never knew you, depart from me, ye that work iniquity." Religious things and games, from their own wicked hearts. They had not bothered to come to Jesus and to hear from the Father. They were lying, children of the devil, perhaps self deceived.
Jer 17:9 The heart is deceitful above all things, and desperately wicked: who can know it?
Jer 17:10 I the LORD search the heart, I try the reins, even to give every man according to his ways, and according to the fruit of his doings.
Our Holy Spirit discernment is needed. The real Holy Spirit, from receiving Jesus as Lord and savior; not eyes glazed, emotional pretense. You may fool the people, but not the Lord.
2 Pet 2:1 But there were false prophets also among the people, even as there shall be false teachers among you, who privily shall bring in damnable heresies, even denying the Lord that bought them, and bring upon themselves swift destruction.
2 Pet 2:2 And many shall follow their pernicious ways; by reason of whom the way of truth shall be evil spoken of.
2 Pet 2:3 And through covetousness shall they with feigned words make merchandise of you: whose judgment now of a long time lingereth not, and their damnation slumbereth not.
Are you fooled by those who wish to make merchandise of you for their own gain? Truly be careful. If they prophesy, is it of God, from his word? Are they really casting out devils and doing wonders? I wonder? Examine all their fruit, not just what they claim. Do they have the fruit of the Spirit?
Getting back to our scriptures from Luke. They may not be with us, maybe in another denomination, but doing the Lord's work. If they are for Jesus, praise God and offer them your fellowship. If they are of another spirit, rebuke them in love and withdraw from them.