Concise Bible Dictionary:

The Hebrew word goi is also translated “Gentiles,” and “people,” and very often “nations:” it is used in contrast to Israel irrespective of those designated being civilized or not. All the nations were idolaters, but this is not implied in the word goi, nor in the ἔθνος of the New Testament, which is more frequently translated “nations” and “Gentiles.” In Matthew 17 ἐθνικός has a peculiar application: if an offending brother will not hear the church, the injunction is “let him be unto thee as an heathen man and a publican,” that is, as an outsider, the heathen being outside the privileges of Israel, as one to be avoided (compare Rom. 16:1717Now I beseech you, brethren, mark them which cause divisions and offences contrary to the doctrine which ye have learned; and avoid them. (Romans 16:17); 2 Thess. 3:6,146Now we command you, brethren, in the name of our Lord Jesus Christ, that ye withdraw yourselves from every brother that walketh disorderly, and not after the tradition which he received of us. (2 Thessalonians 3:6)
14And if any man obey not our word by this epistle, note that man, and have no company with him, that he may be ashamed. (2 Thessalonians 3:14)