Somatostatin receptor5 (SSTR5) is highly expressed in ACTH-secreting pituitary adenomas and is an important drug target for the treatment of Cushing's disease. Two cyclic SST analog peptides (pasireotide and octreotide) both can activate SSTR5 and SSTR2. Pasireotide is preferential binding to SSTR5 than octreotide, while octreotide is biased to SSTR2 than SSTR5. The lack of selectivity of both pasireotide and octreotide causes side effects, such as hyperglycemia, gastrointestinal disturbance, and abnormal glucose homeostasis. However, little is known about the binding and selectivity mechanisms of pasireotide and octreotide with SSTR5, limiting the development of subtype-selective SST analog drugs specifically targeting SSTR5. Here, we report two cryo-electron microscopy (cryo-EM) structures of SSTR5-Gi complexes activated by pasireotide and octreoitde at resolutions of 3.09 Å and 3.24 Å, respectively. In combination with structural analysis and functional experiments, our results reveal the molecular mechanisms of ligand recognition and receptor activation. We also demonstrate that pasireotide preferentially binds to SSTR5 through the interactions between Tyr(Bzl)/DTrp of pasireotide and SSTR5. Moreover, we find that the Q2.63, N6.55, F7.35 and ECL2 of SSTR2 play a crucial role in octreotide biased binding of SSTR2. Our results will provide structural insights and offer new opportunities for the drug discovery of better selective pharmaceuticals targeting specific SSTR subtypes.