Genetic modification is common in research like this, so are injections of various nanoparticles and viruses. The field of optogenetics is based around similar methods
https://www.nature.com/articles/am201590
Optogenetics can be more invasive than what we see with the fruit flies as they usually involve running fiberoptics directly to the desired nerves. Also potentially more useful in growing tissues in petri dishes. new muscle tissue for heart/ethical meat you name it.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5437765/
What we are seeing is sub second rudimentary brainwave manipulation. Literally a rudimentary remote controlled fly.