Craving for cocaine progressively increases in cocaine users during drug-free periods, contributing to relapse. The projection from the infralimbic cortex to the nucleus accumbens shell (IL-NAc) is thought to inhibit cocaine seeking. However, it is not known whether and how IL-NAc neurons contribute to the increased motivation associated with a drug-free period. We first performed cellular resolution imaging of IL-NAc neurons in rats during a drug-seeking test. This revealed neurons with spatial selectivity within the cocaine-associated context, a decrease in activity around the time of cocaine seeking, and an inverse relationship between cocaine-seeking activity and subsequent cocaine motivation. All these properties were reduced by a drug-free period. Next, we transiently activated this projection, which resulted in reduced drug seeking, regardless of the drug-free period. Taken together, this suggests that altered IL-NAc activity after a drug-free period may enhance cocaine motivation without fundamentally altering the projection’s ability to inhibit drug seeking.