Spanish rider Intxausti had won the fourth stage by three seconds ahead of Daniel Martin to take the lead in the overall standings, and he finished safely in the pack on stage five to complete his triumph.
Martin (Garmin) ended up second, 10 seconds back, with Team Sky's David Lopez third, while Mezgec's well-timed sprint saw him edge home ahead of Nacer Bouhanni and Moreno Hofland on the final stage.
The victor was thrilled after the perfect end to an excellent season.
"This victory rounds off a great season for me. I think that taking leadership roles in the Giro made me gain consistence and courage, and now this victory in a World Tour race is sort of a confirmation," Intxausti said.
"I'm growing year by year and that will be my intention for the next season. I'm especially happy about the team.
"I brought what I could and it was amazing how things went this season: podiums in two GT's, the Worlds, every single victory... it really shows our potential."