Lewis, who picked up his second win on the European Tour, seven years after winning the same event in Vilamoura, started the day three shots behind overnight leader Herbert but started brightly to take control.
The Englishman birded three of his opening five holes before adding another birdie at the par-3 8th to turn in 31. Despite then dropping at shot at the 10th, the world No. 184 recovered with further birdies and the 11th and 13th before showing strong nerve to par his remaining five holes and finish 22 under overall.
Herbert was only one shot behind Lewis as the pair entered the final hole, but the Australian shot a double-bogey six as he pursued the all-important birdie. He joined England's Eddie Pepperell, who carded a final-round 4-under-par 67, in a tie for second place at 19 under.
Soo-min Lee shot the lowest round of the day and was the biggest mover on the leaderboard during the final round. The South Korean carded a 7-under-par 64 to move to a tie for fourth place at 17 under overall, alongside Marcus Kinhult.
Oliver Fisher, who made history on Friday by becoming the first player to shoot 59 on the European Tour, finished his week with a round of 2 under to move 16 under overall. The Englishman finished in a tie for seventh alongside Ireland's Shane Lowry.
Sergio Garcia shot another encouraging score ahead of next weekend's Ryder Cup, including an eagle-two at the opening hole. The Spaniard carded a 6-under-par 65, the second lowest of the day, to finish in a tie for ninth at 15 under overall, alongside Portugal's Ricardo Gouveia.