Ecological speciation occurs with the adaptation of populations to different environments and concurrent evolution of reproductive isolation. Phenotypic plasticity might influence both ecological adaptation and reproductive traits. We examined environment-specific gene expression and male mating success in cactophilic Drosophila mojavensis using transcriptome sequencing. This species exhibits cactus-dependent mating success across different species of host plants, with genotype-by-environment interactions for numerous traits. We cultured flies from egg to eclosion on two natural cactus hosts and surveyed gene expression in adult males that were either successful or unsuccessful in achieving copulation in courtship trials. We identified gene expression differences that included functions involved with metabolism, most likely related to chemical differences between host cactus species. Several epigenetic-related functions were identified that might play a role in modulating gene expression in adults due to host cactus effects on larvae, and mating success. Cactus-dependent mating success involved expression differences of genes implicated in translation, transcription, and nervous system development. This suggests a role of neurological function genes in the mating success of D. mojavensis males. Together, these results suggest that the influence of environmental variation on mating success via regulation of gene expression might be an important aspect of ecological speciation.