As a generalization of the well-known linear complementarity problem, tensor complementarity problem (TCP) has been studied extensively in the literature from theoretical perspective. In this paper, we consider a class of TCPs equipped with nonsingular (not necessarily symmetric) M-tensors. The considered TCPs can be regarded as a special class of nonlinear complementarity problems (NCPs), but the underlying mappings in TCPs are not necessarily P0-functions, which preclude the possibility of applying existing Newton-type methods for NCPs to TCPs directly. By introducing a pivot minimum function, we propose an index detecting algorithm, which efficiently exploits the beneficial properties of nonsingular M-tensors and goes beyond algorithmic frameworks designed for general NCPs. Moreover, the proposed algorithm is well-defined in the sense that it generates a nonnegative element-wise nonincreasing sequence converging to a solution of the problem under consideration. Finally, numerical results further support the efficiency and reliability of the proposed algorithm.