Luckily for the Dodgers, the Giants followed suit with a 2-1 loss to the Reds in San Francisco, keeping Los Angeles at 2½ games back in the National League West. The Dodgers haven't lost ground in the division on any day since July 7.
Brandon McCarthy retired nine of his first 10 batters faced, including seven straight through the third inning, but was rudely greeted in the fourth inning by a leadoff double from Brad Miller. That was followed by Evan Longoria homering to left field, giving Tampa Bay a 2-1 lead.
Later in the inning, Steven Souza walked, then scored on a two-out double by catcher Luke Maile.
McCarthy struck out seven on the day, but with 83 pitches was done after just four innings, and suffered his first loss as a Dodger.
His first loss with the Dodgers was the Rays' first win at Dodger Stadium, in five tries, but not the only first on Wednesday.
The Dodgers got their run in the second inning. With runners at the corners, A.J. Ellis stole second base for his first career steal, and when Maile's throw sailed into center field, Joc Pederson strolled home from third base.
Since the departure of Russell Martin, who had 66 steals with the Dodgers, after 2010, the only Dodgers catchers to steal a base before Ellis on Wednesday were Matt Treanor (2012), Ramon Hernandez (2013) and Austin Barnes (2015), each with one.
But that was it against Matt Moore, who struck out five and pitched into the seventh. It was his 10th straight start of at least six innings, with a 2.81 ERA during that span.
Ellis nearly hit a game-tying two-run home run in the seventh against Moore, but his deep drive was caught at the left field wall by Corey Dickerson.
Another rarity happened later in the seventh. Howie Kendrick, who was 2-for-2 with a walk against Moore, fouled out against Kevin Jepsen to end the inning, thanks to a tremendous catch by first baseman Logan Morrison as he tumbled into the stands.
It was the first infield pop out for Kendrick since 2013.
The Dodgers suffered just their fourth loss in their last 18 home games.
The Dodgers have Thursday off, then open a three-game weekend series against the Diamondbacks on Friday night. Kenta Maeda gets the call in the opener, with Zack Godley starting for Arizona.
Home run: Evan Longoria (23)
WP - Matt Moore (7-7): 6⅔ IP, 4 hits, 1 unearned run, 4 walks, 5 strikeouts
LP - Brandon McCarthy (2-1): 4 IP, 4 hits, 3 runs, 2 walks, 7 strikeouts
Sv - Alex Colome (22): 1 IP, 1 strikeout