Coria had dominated the opening two sets of the first all-Argentine final in grand slam history until cramps allowed his opponent back into the match.
The fifth set was a tense battle of nerves but Gaudio had the final say after three hours and 31 minutes.
Gaudio, ranked 44th in the world, became the second Argentine to win at Roland Garros, 27 years after Guillermo Vilas.
Vilas, after whom Coria had been named, was the last Argentine men's winner of a grand slam tournament, at the Australian Open in 1979.
Coria, the third seed, was a clear favourite after winning 37 out of 38 matches on the surface following his surprise defeat to Dutchman Martin Verkerk at the Roland Garros semi-finals last year.