The young rider was set up beautifully by Wout van Aert and Christophe Laporte and he finished comfortably ahead of Red Bull Bora Hansgrohe rider Jordi Meeus.
Race leader Tadej Pogacar cruised home safely in the pack, having seized total control with his mountain masterclass in Andorra on the previous stage.
While Pogacar looks in a league of his own in the battle for the red jersey, sprinter Brennan, 21, has underlined his credentials as one of the best young riders in the peloton.
He held off Pogacar in a sprint at the end of the second stage and showed his power again at the end of the 173-km route from Falcet to Roquetes after easily dealing with the main climb towards the end of the stage.
"When you have Matthew there in a group like that, it's the best card to play and I didn't even need to see the replay to see how he finished that one off," Van Aert said after congratulating his young team mate.
Relishing his second win, Brennan showed his appreciation for having two of the Dutch team's biggest names working for him.
"It's not a bad (job), better than a normal day job," Brennan, who won the prestigious Kuurne-Brussels-Kuurne one-day race this year, told TNT Sports.
"That's my second one in the bag in my first Grand Tour. I'm just very thankful to finish it off again and I think the boys are quite relieved. It was spot on today. Wout and Christophe are the best guys in the world for this type of thing and they supported me all the way into the final."
After the fireworks of the previous day when UAE Team Emirates leader Pogacar lit up the mountains with a 50km solo ride to victory to take the overall lead by three minutes 21 seconds, Wednesday's stage was a slow burner.
Pogacar will look to inflict more pain on his rivals on Thursday with a medium mountain day from Alcossebre to Castellon de la Plana on the Mediterranean.
