[Problem] The purpose of the present invention is to provide a novel pyrazole derivative, or a pharmaceutically acceptable salt thereof, and a pharmaceutical composition containing same and a pharmaceutical use thereof. [Solution] The present invention provides a composition having a TRPM8 inhibitory activity and represented by formula (I) (in the formula, ring A is C6-10 aryl or the like, X is CR4a or the like, R1 and R2 are a hydrogen atom or the like, R3 is a hydrogen atom or the like, R4 is a hydrogen atom or the like, ring B is C6-10 aryl or the like, R5 is a hydrogen atom or the like, R6a is a hydrogen atom or the like, R7a is a hydrogen atom or the like, R7b is a hydrogen atom or the like, R6b is a hydrogen atom or the like, R8 is a hydrogen atom or the like, and n is 0, 1, or 2), or a pharmaceutically acceptable salt thereof. Furthermore, the composition of the present invention represented by formula (I) or the pharmaceutically acceptable salt thereof can be used as a therapeutic agent or prophylactic agent for diseases or conditions caused by hyperexcitability or disorders of afferent nerves.Problema: La presente invención es para proveer un derivado de pirazol novedoso o una sal farmacéuticamente aceptable del mismo, una composición farmacéutica que lo comprende y el uso farmacéutico de la misma. Solución: La presente invención provee un compuesto representado por la fórmula (I) o una sal farmacéuticamente aceptable del mismo, que tiene efectos inhibitorios de TRPM8: (ver Fórmula). en donde el anillo A es arilo de C6-10 o similar; X es CR4a o similar; R1 y R2 son un átomo de hidrógeno o similar; R3 es un átomo de hidrógeno o similar; R4 es un átomo de hidrógeno o similar; el anillo B es arilo de C6-10 o similar; R5 es un átomo de hidrógeno o similar; R6a es un átomo de hidrógeno o similar; R7a es un átomo de hidrógeno o similar; R7b es un átomo de hidrógeno o similar; R6b es un átomo de hidrógeno o similar; R8 es un átomo de hidrógeno o similar; n es 0, 1