Single cells influence, and are shaped by, their local spatial niche. Technologies for in situ measurement of gene expression at the transcriptome scale have enabled the detailed profiling of the spatial distributions of cell types in tissue as well as the interrogation of local signaling patterns between cell types [1]. Towards these goals, we propose a new statistical procedure called niche-differential expression (niche-DE) analysis. Niche-DE identifies cell-type specific niche-associated genes, defined as genes whose expression within a specific cell type is significantly up- or down-regulated, in the context of specific spatial niches. We develop effective and interpretable measures for global false discovery control and show, through the analysis of data sets generated by myriad protocols, that the method is robust to technical issues such as over-dispersion and spot swapping. Niche-DE can be applied to low-resolution spot- and ROI-based spatial transcriptomics data as well as data that is single-cell or subcellular in resolution. Based on niche-DE, we also develop a procedure to reveal the ligand-receptor signaling mechanisms that underlie niche-differential gene expression patterns. When applied to 10x Visium data from liver metastases of colorectal cancer, niche-DE identifies marker genes for cancer-associated fibroblasts and macrophages and elucidates ligand-receptor crosstalk patterns between tumor cells, macrophages and fibroblasts. Co-detection by indexing (CODEX) was performed on the same patient samples, to corroborate the niche-DE results.