The targeting of type III secretion (TTS) proteins at the injectisome is an important process in bacterial virulence. Nevertheless, how the injectisome specifically recognizes TTS substrates among all bacterial proteins is unknown. A TTS peripheral membrane ATPase protein located at the base of the injectisome has been implicated in the targeting process. We have investigated the targeting of the EspA filament protein and its cognate chaperone, CesAB, to the EscN ATPase of the enteropathogenic E. coli (EPEC). We show that EscN selectively engages the EspA-loaded CesAB but not the unliganded CesAB. Structure analysis revealed that the targeting signal is encoded in a disorder-order structural transition in CesAB that is elicited only upon the binding of its physiological substrate, EspA. Abrogation of the interaction between the CesAB-EspA complex and EscN resulted in severe secretion and infection defects. Additionally, we show that the targeting and secretion signals are distinct and that the two processes are likely regulated by different mechanisms.