Dropping serve twice in the first set, Gasquet rallied from 3-0 down by breaking Mathieu's serve three times on the way to a 13th career title and third at the Montpellier event.
"I struggled to get into the match, because I was still tired from Saturday," Gasquet said, referring to his three-set win against Germany's Dustin Brown in the semifinals. "I could hardly serve and Paul was hitting the ball hard."
Gasquet said he had an MRI scan before the match and got the all-clear to play.
"It was reassuring. Medically there was no reason not to play," he told sports daily L'Equipe. "Warming up was tough, but I held on until the end. It was hard to serve because it was my abs. I had to dig deep to get through it."
Mathieu, who won the last of his four titles back in 2007, continued to cause Gasquet problems in the second set, but he failed to take his two break-point chances.
Gasquet, now ranked 10th, also won the Montpellier title in 2013.
The victory moved him to 13-12 in career finals. He is up 6-2 on 34-year-old Mathieu in their head-to-heads, with Mathieu's previous victory coming six years ago.
"It is great for me to win another title," the 29-year-old Gasquet said. "I am very proud to win my third title here, because it was a great match against a good friend. He had nothing to lose."