Ellis doubled and scored in the third, before being tossed when he and Mattingly argued a called third strike in the fourth, but the Dodgers still improved to 12-2 since the All-Star break.
The NL West leaders remained unbeaten on the road since a loss at San Francisco on July 6 and matched the 1924 Brooklyn Robins for the longest streak in franchise history.
Nick Punto added two hits and drove in two runs, and Adrian Gonzalez and Yasiel Puig each added a pair of hits and scored a run for the Dodgers.
Los Angeles took control early, scoring two in the third and two more in the fourth while building a 5-1 lead and chasing All-Star Travis Wood (7-8).
That was enough for Ryu Hyun-jin (10-3), who became the first Dodgers rookie to win 10 games since Kazuhisa Ishii in 2002. The left-hander matched a season high by allowing 11 hits in 5-1/3 innings, but held Chicago to just two runs. He also struck out six without a walk.
ROCKIES 4, PIRATES 2
In Pittsburgh, Pennsylvania, Jhoulys Chacin allowed one run on six hits over eight innings as Colorado snapped a four-game losing streak with a win over Pittsburgh.
Chacin (10-5), who has won seven of his past nine decisions, stayed in the game after taking a sharp line drive off the bat of Starling Marte in the fifth inning.
Colorado’s Troy Tulowitzki had a solo homer and an RBI single, and Todd Helton had a two-run single 16 years to the day after making his major-league debut in the same city.
Pirates rookie Gerrit Cole (5-5) needed 102 pitches to make it through 5-1/3 innings, allowing three runs on three hits and two walks with six strikeouts.
CARDINALS 13, REDS 3
In Cincinnati, Ohio, David Freese set the tone with a bases-loaded double in the first inning, while Daniel Descalso hit two of St Louis’ three homers in a win over Cincinnati.
The Cardinals have emerged from a deep hitting slump by scoring 13 runs in each of their past two games. It is the first time this season they have had double-digit run totals in consecutive games.
Shelby Miller (11-7) limited the Reds’ slumping offense to two singles over the first five innings before Joey Votto hit a three-run homer in the sixth.
Bronson Arroyo (9-9) matched his season high by giving up seven runs in only 3-2/3 innings, his shortest outing of the season.
In other NL action, it was:
‧ Braves 6, Phillies 4
‧ Nationals 4, Brewers 1
In interleague play, it was:
‧ Marlins 10, Indians 0
‧ Padres 7, Yankees 2
‧ Mets 4, Royals 2, 11 inns
‧ Giants 4, Rays 1
‧ Diamondbacks 7, Red Sox 6