Underwater acoustic target identification is a task in which two acoustic samples are determined whether they belong to the same target, which is helpful for downstream tasks such as target recognition or target tracking. In this paper, we propose a method base on the Siamese network for underwater acoustic target identification. Compared with the traditional classification-based method, our method reduces the impact of data scarcity. It is more robust in the case of unseen target categories, which is more suitable for practical applications. We test the system performance on two publicly available datasets: Deepship and ShipsEar. The accuracy of our system can achieve 88.22% when the data are from the same source; when the data are from different sources, the identification accuracy can reach 77.34%. Experimental results show that our proposed method has both high accuracy and good generalization performance.