Updated

Yu Darvish again resembled the dominating pitcher the Texas Rangers are going to need him to be during the pennant chase.

That still wasn't enough to get a victory.

Darvish allowed consecutive two-out doubles in the seventh, then didn't come back out for the eighth because of cramping in his right leg. The Rangers lost 1-0 to rookie right-hander Gerrit Cole as the Pittsburgh Pirates clinched their first winning season since 1992.

"We needed him to step up and he stepped up tonight. He really threw the ball well, he moved the ball around well, he kept it down in the zone," manager Ron Washington said. "Just one pitch, and that was the only opportunity they had, and they took advantage of it. And that's the ball game."

Texas lost for the fourth time in five games, and still needs one more win to clinch its fifth consecutive winning season. The Rangers dropped two games behind idle AL West-leading Oakland.

Darvish is 0-3 his last five starts, all Rangers losses. The Japanese right-hander struck out six while allowing one run and four hits while throwing a season-low 81 pitches.

Washington said removing Darvish before the eighth was precautionary.

"It's minor," Washington said. "No level of concern."

Pittsburgh had lost a season-high four games in a row since getting its 81st victory last Tuesday at Milwaukee.

The Pirates (82-61) didn't get a runner to second base against Darvish (12-8) until Marlon Byrd's two-out double in the seventh. He came home when Pedro Alvarez, mired in a 5-for-41 slump over 12 games, followed with a double.

They finally have their winning season after taking the opener of a three-game interleague series between wild-card leaders.

"It's a huge deal for me. It certainly thrills me to be a part of that," said Pirates hitting coach Jay Bell, a shortstop on that 1992 team.

Cole, who had a career-high nine strikeouts over seven scoreless innings, got out of a self-induced jam in the sixth after consecutive walks to Elvis Andrus and Alex Rios, his only walks in the game. Andrus got his 38th career stolen base — the Rangers pulled off a double steal when Rios reached before Adrian Beltre grounded out.

"The sixth inning could have gotten out of hand," Cole said. "I was just able to get the ball down on them."

Tony Watson pitched a perfect eighth, his 14th consecutive scoreless outing. Mark Melancon worked the ninth for his 12th save in 14th chances to close out Pittsburgh's 16th shutout of the season.

Darvish started feeling the cramps during the seventh. There was a short delay after the Rangers took the field in the eighth before Tanner Scheppers came out of the bullpen.

Pittsburgh hadn't had a winning season in more than two decades since the last of their three consecutive NL championship series appearances. Their last postseason before that was the 1979 World Series championship team.

"I understand the significance of this game, the 82nd win, more than probably at least most of the players here," said second baseman Neil Walker, the team's first-round pick in 2004. "As big as this win is for the city of Pittsburgh and the organization, and as big a deal as the media is going to make out of it, we still have a lot of baseball to play. We've got a lot of games we need to win, we're in a tight race."

The Pirates moved within a game of NL Central-leading St. Louis, which swept Pittsburgh in three games over the weekend.

NOTES: It was the 14th 1-0 game ever at Rangers Ballpark, which is in its 20th season. It was the second this season, both Rangers losses. ... Pirates CF Andrew McCutchen had a leadoff triple in the ninth. He was thrown out trying to score on Justin Morneau's chopper to second baseman Ian Kinsler. ... Rangers LF Jim Adduci left the game after his at-bat in the fifth inning, when he sustained a right biceps strain while striking out. ... Darvish upped his major league-leading strikeout total to 246. ... Beltre was 1 for 22 over six games before his two-out single in the ninth.