These hormone-secreting cells - endocrinocytes - are interspersed among a much larger number of epithelial cells that secrete their products (acid, mucus, etc.) into the lumen or take up nutrients from the lumen.
The classical GI hormones are secreted by epithelial cells lining the lumen of the stomach and small intestine. Endocrine control over digestive functions is provided by the so-called enteric endocrine system, which is summarized elsewhere. Robust control systems are required to coordinate digestive processes in man and animals, and are provided by both the nervous and endocrine systems. If you are like most people, you eat several meals and occasional snacks each day, but rarely think about the immense number of tasks that must be performed by your digestive system to break down, absorb and assimilate those nutrients.