HOUSTON — The A’s might be able to look back to July 29 as a watershed day in the American League West pennant race.

At just about the same moment that the Baltimore Orioles stung the second-in-the-west Angels with a 12-inning, 7-6 win, Brandon Moss beat the Houston shift with a bullet of a single that snapped a 4-all tie at 10:13 CDT. The A’ would go on to win, 7-4.

It was part of a rousing six-run ninth inning that included a two-run pinch-hit single from Alberto Callaspo, a game-tying RBI hit by Yoenis Cespedes and a clinching two-run double to the deepest part of center field from Josh Donaldson.

So instead of possibly seeing their lead shrink in the West to a mere one-half game, the A’s own a 2 1/2-game lead in the division heading into Wednesday. There are still two months to play, but that two-game cushion has to look good to the A’s about now.

In a last-ditch effort to avoid losing the first two games of the series, the A’s needed some magic. They got some. Derek Norris singled to third base and Reddick delivered an opposite-field double. Callaspo singled home both runners.

Rookie pinch-runner Billy Burns was forced at second base by a John Jaso grounder, but the A’s got the tying runner to second base anyway when Houston reliever Chad Qualls’ wild pitch gave Jaso the freedom to advance. Jed Lowrie then walked before Cespedes dumped a soft fly ball into short right field.

It was Cespedes’ third hit of the night, and it tied the game a 4-4, knocking Astros closer Qualls out of the game. Lefty Tony Sipp, asked to pitch to Moss, caught a huge break when Moss’s bid for a three-run homer soared to the outside of the foul pole on a 2-0 pitch.

Moss emerged the ultimate victor, however, beating the shift employed by the Astros with a liner that second baseman Jose Altuve, stationed in medium right field, couldn’t track down.

And Donaldson capped the six-run uprising with a monster double to center off Jose Veras.

Before the ninth inning, this was something of a throwback game for A’s starter Jeff Samardzija, who was used to getting no support from the offense when he played for the Chicago Cubs before July 4, when he and Wednesday starter Jason Hammel were traded to Oakland.

With the Cubs, it had taken him 11 starts to get 20 runs scored on his behalf. With Oakland he got that many in his first four starts. But it was back to old trends on Tuesday as the A’s got just one run in the first seven innings with Samardzija otherwise pitching well enough to win.

He was stung for a first inning solo homer hit by Marwin Gonzalez, then allowed just two more base runners through the end of the fourth inning. In the top of the fifth the A’s got on the board on center fielder Reddick’s homer as Oakland pulled into a 1-all tie, but it would not last long.

It was a string of four pitches that would do him in. Robbie Grossman opened with a single, then tried to steal second base on the first pitch to Kiké Hernandez. He was called safe, and the A’s put the play up for review. The throw from Derek Norris beat Grossman, that was undeniable, but there was not enough visual evidence to have him called out, so the steal stood.

It would prove to be crucial. The next pitch saw Hernandez triple off the wall in left-center to break the tie, and the pitch after that was an RBI single from Jose Altuve good for a 3-1 lead.

The score stood there until the seventh, when the Astros finally ran Samardzija from the game. Jon Singleton opened with a walk, took second on a grounder and scored on Hernandez’s two-out double. Dan Otero came in from the bullpen to keep things from getting further out of hand, but a three-run deficit with just two innings to play was a daunting challenge.

Scott Feldman, the Astros starter, came into the game having lost three consecutive starts, including his last one a week ago in Oakland. But he had the benefit of some nice defense working for him this time.

Oakland had a chance for a big inning in the fourth when Cespedes doubled, stole third and Donaldson walked with one out. Stephen Vogt crushed a line drive toward left field, but third baseman Gonzalez made a spectacular leaping catch to deny Vogt at least a double and at least one RBI, and the inning went no further.

Reddick, getting his first start of the season in center, led off the fifth inning with a game-tying homer down the right field line, and later in the inning Jaso singled and Lowrie walked. The A’s would go no further, and would only have one base runner, a two-out walk in the sixth, from the sixth through the eighth innings.