Innate behavior, such as courtship behavior, is controlled by a genetically defined set of neurons. To date, it remains challenging to visualize and artificially control the neural population that is active during innate behavior in a whole-brain scale. Immediate early genes (IEGs), whose expression is induced by neural activity, can serve as powerful tools to map neural activity in the animal brain. We screened for IEGs in vinegar fly Drosophila melanogaster and identified stripe/egr-1 as a potent neural activity marker. Focusing on male courtship as a model of innate behavior, we demonstrate that stripe-GAL4-mediated reporter expression can label fruitless (fru)-expressing neurons involved in courtship in an activity (experience)-dependent manner. Optogenetic reactivation of the labeled neurons elicited sexual behavior in males, whereas silencing of the labeled neurons suppressed courtship and copulation. Further, by combining stripe-GAL4-mediated reporter expression and detection of endogenous Stripe expression, we established methods that can label neurons activated under different contexts in separate time windows in the same animal. The cell assembly analysis of fru neural population in males revealed that distinct groups of neurons are activated during interactions with a female or another male. These methods will contribute to building a deeper understanding of neural circuit mechanisms underlying innate insect behavior.