Including the open water worlds, Lurz had won the 5K title seven consecutive times but he couldn't match Mellouli's sprinting.
"It's OK, I'm 33 years old and I started working again in January," Lurz said. "I knew in the last 50 meters I would not win. (Mellouli) swims the 100 free five seconds faster than me or more. This is the problem."
Mellouli won the 10K and took bronze in the 1,500-meter freestyle at last year's London Games to become the first swimmer to win medals in both the pool and open water at the same Olympics. And he won the 1,500 at the 2008 Beijing Games.
The 29-year-old Mellouli had planned to retire after the London Games but he changed his mind a couple of months later, and only began training again six months ago.
"This year was supposed to be a year off for me," he said. "So to come back here after a solid two months of training and to be on top of the world is quite exciting for me."
If there were questions over his form ahead of this race, Mellouli is now clearly the favorite for Monday's 10K.
"I'm just going to celebrate the 5K and worry about the 10 after a day off tomorrow," he said.
"It's definitely a boost of confidence. It doesn't hurt to win the 5K going into the 10K, that's for sure."
Mellouli is also entered in three pool events the 400, 800 and 1,500 free but won't decide on those races until after the open water events. He trains at the University of Southern California with women's 5K winner Haley Anderson of the United States.
"It's a great job for the Trojans today," he said, thanking his American coaches Catherine Vogt, Jon Urbanchek and Dave Salo. "It's an awesome group."
Mellouli also attended an altitude training camp with Michael Phelps' former coach, Bob Bowman, in Colorado Springs, Colorado, six weeks ago.
While Mellouli had criticized the water as dirty in training earlier in the week following a rainstorm that appeared to spread pollution, he had no complaints after winning.
"Conditions were great," he said. "The water cleaned up a lot. I'm really happy with the venue."
Midway through the race, Fernando Sevilla Garcia of Mexico was disqualified for failing to swim around a buoy.
The race took place in ideal sunny conditions, with the water 24 degrees Celsius (75 Fahrenheit) and the air temperature about 30 Celsius (86 Fahrenheit). With the course right along the docks, fans watching from the shore had a great view.