The Echo Knight fighter has the Manifest Echo feature, which grants the following ability, among others (EGtW, p. 183):
When a creature that you can see within 5 feet of your echo moves at least 5 feet away from it, you can use your reaction to make an opportunity attack against that creature as if you were in the echo's space.
The War Caster feat includes the following benefit (PHB, p. 170):
When a hostile creature's movement provokes an opportunity attack from you, you can use your reaction to cast a spell at the creature, rather than making an opportunity attack.
If an Echo Knight has the War Caster feat and knows a spell like, say, booming blade, can they use the spell in place of an opportunity attack provoked by an enemy moving away from the echo?