The main forms of gas kicks into the wellbore during drilling in fractured carbonate reservoirs are underbalanced pressure and gravity displacement. These two forms of gas kicks have different mechanisms of gas entry into the wellbore and different well control measures, which require the timely identification of the type of gas kick when it occurs. A two-phase flow model with a wellbore-formation coupling was developed, based on the gas kick rate models. The variation characteristics of the bottomhole gas influx rate, the wellbore free gas, the bottomhole pressure, the bottomhole pressure change rate, the pit gain and the outlet flow rate during an underbalanced pressure gas kick and a gravity displacement gas kick, were compared and analyzed. Combining the dynamic time warping (DTW) and the wellbore-formation, coupled with a two-phase flow model, an identification method of the gas kick type, based on the DTW was proposed. Following the detection of the gas kick, the identification is performed by calculating the DTW distance between the surface parameter time series, obtained from the two-phase flow simulation and the surface parameter time series, measured in real time. The field example results show that the method can identify the type of gas kick, based on the real-time surface measurement parameters and provide a basis for taking targeted well control measures.