Cells have evolved their communication methods to sense their microenvironments and send biological signals. In addition to communication using ligands and receptors, cells use diverse channels including gap junctions to communicate with their immediate neighbors. Current approaches, however, cannot effectively capture the influence of various microenvironments. Here, we propose a novel approach to investigate cell neighbor-dependent gene expression (CellNeighborEX) in spatial transcriptomics (ST) data. To categorize cells based on their microenvironment, CellNeighborEX uses direct cell location or the mixture of transcriptome from multiple cells depending on ST technologies. For each cell type, CellNeighborEX identifies diverse gene sets associated with partnering cell types, providing further insight. We found that cells express different genes depending on their neighboring cell types in various tissues including mouse embryos, brain, and liver cancer. Those genes are associated with critical biological processes such as development or metastases. We further validated that gene expression is induced by neighboring partners via spatial visualization. The neighbor-dependent gene expression suggests new potential genes involved in cell-cell interactions beyond what ligand-receptor co-expression can discover.