Both teams started a fairly balanced match with no goals scored in the first half at San Siro.
Just a few moments after Karim Benzema hit the woodwork for France, Spain took the lead with Mikel Oyarzabal's goal in the 64th minute.
France recuperated quickly as Benzema's screamer went to the top corner of the goal despite Spain's goalie Unai Simon in minute 66.
Kylian Mbappe's left-footed strike under Unai Simon in the 80th minute completed the turnaround for France.
This victory gave France their first-ever UEFA Nations League title.
Earlier on Sunday, Italy became third, beating Belgium 2-1 in the UEFA Nations League.