An invasion is an action undertaken by one government where its military enters the territory of another government for the purpose of controlling such territory or the people there.
In 2366, the Borg lauched an invasion of Earth they assimilated Captain Jean-Luc Picard into the collective where he became Locutus of Borg and forced him to help them destroy 39 Federation and Klingon ships by using his knowlege about Starfleet at the Battle of Wolf 359. The crew of the Enterprise-D was able to use Locutus' connection to the Borg to defeat the invading Borg cube. (TNG: "The Best of Both Worlds", "The Best of Both Worlds, Part II")
After the Antwerp Conference bombing of 2372 and fluctuations of The Bajoran wormhole indicating a possible Dominion invasion, Admiral Leyton and Captain Benjamin Sisko convince the President of the United Federation of Planets Jaresh-Inyo to declare State of emergency the incident which turned out to be staged by Leyton to attempt a Coup d'état of the Federation. This was exposed by Captain Sisko, forcing Leyton to resign his commission. (DS9: "Homefront", "Paradise Lost")
In 2373, the Borg again attempted to invade Earth by traveling back to April 4th 2063 to prevent First Contact and assimilating a post-World War III Earth where they where defeated by the crew of the USS Enterprise (NCC-1701-E). {Star Trek: First Contact)