Sunweb's Matthews, who also won the second day of racing earlier in the week, pipped Phil Bauhaus by a tyre's width following the final sprint after a flat route which ended in the town of Vilaseca.
Lopez, of Astana, holds onto his 14sec advantage over Briton Adam Yates and is 17sec in front of fellow countryman Egal Bernal.
"I definitely didn't expect this coming into Catalonia this year. I was expecting to come here and just train through it basically and now I come out of it with two World Tour stage wins," Matthews said.
The peloton stepped up the pace on the five-man breakaway, which at one stage held a three-minute lead, with 40km of the 174km route remaining.
With 12km left, the sprinters, including Matthews, caught up with the group.
Sunday's final 143km stage starts and ends in Barcelona with the biggest climb an ascent up the 485m Creu d'Ordal as 25-year-old Lopez bids to maintain his leader's jersey to add to his Tour of Colombia title earlier in the year.
Results from the sixth stage of the Tour of Catalonia, 174.3km from Vals to Vilaseca on Saturday:
1. Michael Matthews (AUS/SUN) 3h 56min 36sec, 2. Phil Bauhaus (GER/BAH) same time, 3. Daryl Impey (RSA/MIT) st, 4. Patrick Bevin (NZL/CCC) st, 5. Mikel Aristi (ESP/EUS) st, 6. Hugo Hofstetter (FRA/COF) st, 7. Ryan Gibbons (RSA/DDT) st, 8. Miguel Angel Lopez (COL/AST) st, 9. Rafal Majka (POL/BOR) st, 10. Enric Mas (ESP/DEC) st
1. Miguel Angel Lopez (COL/AST) 25hrs 53min 41sec 2. Adam Yates (GBR/MIT) at 14 sec, 3. Egan Bernal (COL/SKY) 17, 4. Nairo Quintana (COL/MOV) 25, 5. Daniel Martin (IRL/UAE) 46, 6. Steven Kruijswijk (NED/JUM) 56, 7. Michael Woods (CAN/EF1) 1:42, 8. Romain Bardet (FRA/ALM) 1:44, 9. Rafal Majka (POL/BOR) 2:27, 10. Marc Soler (ESP/MOV) 2:36.