With a man on second base in the ninth, Astros manager Brad Mills elected to intentionally walk left-handed hitting James Loney, who already had three hits, to let Lopez face the righty-swinging Ellis. The move backfired.
"With [Lopez], how good he's been all year especially with right-handed hitters, I think that was it," Mills said. "We wanted to set up a double play. There's everything right there. [Ellis] just put a nice swing on it, there's no doubt about it."
Astros lefty Wesley Wright was called upon to face the left-handed hitting Andre Ethier to start the frame, and he was ahead 0-2 before hitting him with a pitch. That was the only batter Wright faced before Mills went to Lopez, and Ethier eventually scored the winning run to give Wright the loss.
"It was one of those where I had him exactly where I wanted him," Wright said. "I tried to go in and I just got a little bit too far in. It's frustrating. We had a chance to win the game, and that run set the inning off to a bad start."
Houston jumped out in front 2-0, but it easily could have been more as six runners were left on base in the first three innings. That included a bases-loaded, none-out situation in the second where only one run scored.
With two outs in the frame, Astros left fielder J.D. Martinez hit a sinking line drive to right field on which Ethier made a sliding catch.
"I felt like we had them," Martinez said. "Especially that inning where we had bases loaded and the one that I hit to Ethier, he made a nice play on. If that falls or if that gets by him, it's probably a different outcome to the game."
The Astros pieced together a two-out rally in the eighth with a pair of walks and Jason Castro's RBI double that hit the glove of Dodgers third baseman Jerry Hairston. As the ball bounded into foul territory, Brian Bogusevic came around to score from second.
But the Astros again left the bases loaded, setting the stage for Ellis' heroics an inning and a half later.
"I've faced that guy a few times in Houston and knowing he likes to work his sinker, I was just looking for something elevated," Ellis said. "I was able to find a fastball to hit and I was able to put a good swing on it tonight."
Astros righty Bud Norris labored from the start, needing 116 pitches to last 4 2/3 innings. Norris was the first Astros starter not to last five innings since Lucas Harrell pitched four innings on April 13.
That stretch of 38 consecutive games came to an end as Dodgers hitters worked Norris deep into counts, frustrating him with countless foul balls.
"That's what good hitters do," Norris said. "They definitely fouled off a lot of stuff. They battled and that's what they're trying to do is make me make mistakes in the zone. The ones I did, they punished me for."
Mills put it simply, saying, "I can't believe how many pitches they fouled off."
Still, Norris limited the damage to three runs on eight hits, and he left with his team trailing by one. Tony Gwynn's two-out, two-strike, two-run single put the Dodgers ahead by a run in the bottom of the fourth, and it would stay that way until Castro's double.
The three runs Norris allowed were two more than he had given up in his four previous May starts combined. Norris said the absence of an effective breaking ball was what hurt him most.
The loss marked the fifth time this season the Astros have had an opponent walk off on them -- this one coming at the end of what was almost a four-hour game.
"You're playing for so long, you're battling for so long, it's back and forth and now it's happened to us [five] times," Martinez said. "You've just got to forget about it."
Martinez gave the Astros a bit of an injury scare in the fourth inning when he made a running catch before colliding awkwardly with the left-field wall. He remained in the game and afterward said, while his shoulder felt sore, it was nothing serious.