WASHINGTON—A Trump campaign adviser was in touch in the fall of 2016 with a person he said was a Russian former spy, special counsel Robert Mueller’s office said in a court filing that links cases against top former Trump aides with the wider probe into Moscow’s election meddling.

Richard Gates, the campaign adviser, told London-based lawyer Alex van der Zwaan that his longtime business associate in Ukraine was a “former Russian intelligence officer,” with the GRU, Russia’s military-intelligence agency, prosecutors on Mr....