Underwater acoustic target recognition is a widely investigated issue in the field of underwater acoustics. Many good results have been reported for underwater acoustic target recognition. However, in practical applications, the strong demand for labeled data for underwater acoustic target recognition is a big obstacle. In order to solve this problem, researchers have explored few-shot learning and unsupervised methods in various papers. A Siamese network is proposed which is composed of one-dimensional convolution and Long Short-Term Memory (LSTM) neural networks, called 1DCLSN. A structure for 1DCLSN is designed which combines contrastive information with label information and obtains satisfactory recognition results. In addition, the contrastive loss function with a different clustering term is modified to improve the performance. With only few labeled training samples, the performance of the proposed approach is better than those of other deep learning methods. The experiment shows the great potential of our method.