Depay, 27, will join Barca when his contract with Lyon expires at the end of June. A statement from the Catalans said he will sign a deal with the club until the end of the 2022-23 campaign.
Personal terms were agreed with the player and a fee of around €25 million was set with Lyon, but the club were unable to accommodate him within their La Liga-imposed wage cap.
Koeman, who worked with Depay previously when he was the Dutch national team coach, wanted the forward again in January. However, Barca had no president in place to sanction a transfer.
The Catalans had also hoped to sign Depay's Dutch teammate Georginio Wijnaldum upon the expiry of his contract with Liverpool, but, as first revealed by ESPN, he instead opted to move to Paris Saint-Germain.
He struggled to replicate that form at Old Trafford, though, and was eventually sold to Lyon less than two years later for €16m.
In four-and-a-half seasons in France, Depay has netted 76 times in 178 appearances, including 22 this past season as Lyon finished fourth in Ligue 1.
Depay's arrival at Barcelona further increases their options in attack. Pending sales and contract renewals, he will compete with Aguero, Lionel Messi, Antoine Griezmann, Ousmane Dembele, Ansu Fati, Martin Braithwaite, Philippe Coutinho and Francisco Trincao for a starting position.