Anthony Santander homered for Baltimore, and Ramón Urías drove in two runs. Austin Hays had three of the team's 14 hits.
The Orioles had won six of seven when they arrived in Chicago. But they dropped the first two of the weekend series by a combined score of 13-5.
Baltimore right-hander Dean Kremer (8-3) struck out seven while working five innings of three-run ball. Félix Bautista pitched a perfect ninth for his 19th save in 23 chances.
Chicago had won a season-high five straight. Mike Tauchman and Christopher Morel homered for the Cubs, who finished with three hits.
Ryan O'Hearn sparked Baltimore's winning rally with a leadoff single in the sixth against Jameson Taillon (2-5). O'Hearn advanced to third on Aaron Hicks' double and scored on Urías' sacrifice fly, tying it at 3.
Anthony Kay then replaced Taillon, and Frazier and Mateo hit RBI singles to give the Orioles a 5-3 lead.
Chicago had runners on second and third after a double steal in the seventh, but Yennier Cano retired Nico Hoerner on a grounder to second for the final out.
Adley Rutschman added an insurance run with an RBI double off Hayden Wesneski in the ninth. Rutschman hit a two-run homer in the Orioles' 3-2 loss on Saturday.
Chicago jumped in front when Tauchman launched his first career leadoff homer on Kremer's first pitch of the game. Tauchman also made a nice defensive play in the top half of the first, throwing out Hays when he tried to score on Santander's flyout.
Santander led off the fourth with his 10th homer on a 3-2 pitch by Taillon. Urías added an RBI single later in the inning.
The Cubs responded with two runs in the bottom half, taking advantage of some shoddy defense by the Orioles.
Cody Bellinger reached third when O'Hearn misplayed his two-out liner to right for an error. Morel followed with his 13th homer, a drive to left-center on a 3-1 pitch.
Morel was recalled from Triple-A Iowa on May 8. He has played in just 31 games this year with Chicago.
Taillon was charged with four runs and eight hits in 5 1/3 innings.
Orioles: C James McCann was placed on the 10-day injured list with a left ankle sprain. C José Godoy was promoted from Triple-A Norfolk. ... 3B Gunnar Henderson was scratched because of a stomach flu.
Orioles: Following a day off, RHP Kyle Bradish (2-3) starts against the Tampa Bay Rays in the opener of a three-game series. Bradish went a season-high seven innings in a loss to Toronto in his last start.
Cubs: LHP Drew Smyly (6-4) is Monday's scheduled starter at Pittsburgh.