Internal states of the brain profoundly influence behavior. Fluctuating states such as alertness can be governed by neuromodulation, but the underlying mechanisms and cell types involved are not fully understood. We developed a method to globally screen for cell types involved in behavior by integrating brain-wide activity imaging with high-content molecular phenotyping and volume registration at cellular resolution. We used this method (MultiMAP) to record from 22 neuromodulatory cell types in behaving zebrafish during a reaction-time task that reports alertness. We identified multiple monoaminergic, cholinergic, and peptidergic cell types linked to alertness and found that activity in these cell types was mutually correlated during heightened alertness. We next recorded from and controlled homologous neuromodulatory cells in mice; alertness-related cell-type dynamics exhibited striking evolutionary conservation and modulated behavior similarly. These experiments establish a method for unbiased discovery of cellular elements underlying behavior and reveal an evolutionarily conserved set of diverse neuromodulatory systems that collectively govern internal state.