Semantic relatedness between context information and entities, which is one of the most easily accessible features, has been proven to be very useful for detecting the semantic relation held in the text segment. However, some methods fail to take into account important information between entities and contexts. How to effectively choose the closest and the most relevant information to the entity in context words in a sentence is an important task. In this paper, we propose selection gate-based networks (SGate-NN) to model the relatedness of an entity word with its context words, and select the relevant parts of contexts to infer the semantic relation toward the entity. We conduct experiments using the SemEval-2010 Task 8 dataset. Extensive experiments and the results demonstrate that the proposed method is effective for relation classification, which can obtain state-of-the-art classification accuracy.