Left in the game to bat and with his team trailing by two runs, Lyles drew a two-out walk off Pittsburgh Pirates reliever Clay Holmes to load the bases and set the stage for dramatic rally as Milwaukee eked out a 7-6 victory.
"He did a good job standing there," Milwaukee manager Craig Counsell said of Lyles. "That was his job. I just said, `Don't swing."
Lyles said he knew Holmes was struggling to spot his pitches.
"I was going to give him the first strike and then (Counsell) was going to let me know if we were going to continue to take. A couple close pitches in there, but I had the take sign, so I wasn't swinging."
After the walk to Lyles, Erik Kratz tied the game with a two-run single off Holmes (1-3). Orlando Arcia followed with a walk-off single and was mobbed on the field by his teammates as he put an end to the 5-hour, 36-minute contest.
"After he walked the pitcher, I knew the pressure was on (Holmes), it wasn't on me," Arcia said through team translator Carlos Brizuela. "I just looked for a good pitch to put in play."
The Pirates had taken a 6-4 lead in the top of the 15th. Francisco Cervelli's bloop single with two outs drove in the go-ahead run. A second run scored after Brewers second baseman Jonathan Schoop booted the ball as Cervelli's hit fell softly into short right field.
In the Brewers' half of the inning, Jesus Aguilar drew a one-out walk and moved to second on a wild pitch. After Hernan Perez walked, Ryan Braun struck out. Lyles then walked, bringing Kratz to the plate.
Lyles (3-4), the ninth Milwaukee pitcher, got the win.
The Pirates tied the score in the ninth on Starling Marte's two-out, run-scoring single off Jeremy Jeffress, who blew his fifth save of the season on a day when the Brewers sent struggling former All-Star closer Corey Knebel to the minors.
Mike Moustakas's two-out, two-run homer into the second deck in right field extended the lead to 4-0 in the first.
Steven Brault pitched four hitless innings of relief for the Pirates.
The Brewers halted a five-game losing streak to Pittsburgh.
"It's not the way you want to finish, for sure," Pirates manager Clint Hurdle said.
The Brewers demoted ex-closer and 2017 All-Star Knebel to Triple-A Colorado Springs on Friday to work on his mechanics. The right-hander has a 7.24 ERA since the All-Star break that has raised his season ERA to 5.08. In his last seven appearances, Knebel is 0-2 with an 11.37 ERA.
"It's not easy and we don't have a lot of time left to make adjustments," Counsell said. "But we thought the best chance for us to get Corey throwing the ball well again is to give him this break, give him some time to work."
General manager David Stearns declined to comment on reports that the Brewers had claimed Cincinnati Reds pitcher Matt Harvey on revocable waivers but failed to come to terms on a trade. "There are a lot of players being put on waivers. We've certainly claimed some," Stearns said.
Pirates second baseman Kevin Newman got his first major league hit, a double to left in the second.
GOOD TO BAD
Yelich's night started out well. His first-inning homer, his 22nd of the season, set a career single-season best and extended his hitting streak to 10 games. Then it got ugly as he grounded into three double plays and struck out twice while going hitless in his final six at-bats.
Pirates: Reinstated INF/OF Sean Rodriguez (strained left abdominal muscle) from the 10-day disabled list. He pinch-hit in the 11th. ... 2B Josh Harrison (strained left hamstring) didn't start for the fourth consecutive game but entered the game in the ninth. ... SS Jordy Mercer (strained left calf) remained out of the lineup.
Brewers: Reinstated RHP Joakim Soria (right adductor strain) and RHP Zach Davies (rotator cuff inflammation and back stiffness) from the 10-day DL. Optioned Davies to Class-A Wisconsin. ... INF/OF Nick Franklin has begun a rehab assignment with the Rookie Arizona Brewers. Franklin is on the 60-day DL (right quad strain). ... OF Lorenzo Cain remained in the game after being hit in the left shoulder by an Edgar Santana fastball in the seventh.
Pirates: Jameson Taillon (9-9, 3.58 ERA) is 2-4 with a 3.42 ERA in nine career starts against Milwaukee, including 1-1 in three starts this season.
Brewers: Jhoulys Chacin (13-4) will make his team-leading 28th start. He is 0-1 with a 1.53 ERA in three starts against Pittsburgh this season.
More AP baseball: https://apnews.com/tag/MLBbaseball and https://twitter.com/AP-Sports
The Chicago Cubs will try to move closer to locking up another National League Central title when they visit the Chicago White Sox to wrap up a three-game series on Sunday afternoon at Guaranteed Rate Field.
The Oakland Athletics can clinch their first playoff spot since 2014 when they complete a three-game series against the Minnesota Twins on Sunday afternoon.
Jose Ramirez speaks with Pedro Gomez about his decision to leave school at age 12 and speak to kids to not make the same mistake.
Texas left-hander Martin Perez will have two more chances to help the Rangers decide his future with the team, beginning Sunday when he starts against the Seattle Mariners in the final game of the season at Globe Life Park in Arlington, Texas.
The Athletics walk-off for the second-straight night, this time on a wild pitch, for their fourth-straight win.
For most of the season, Houston Astros manager A.J. Hinch has worked the line between managing the workload of his starters while letting his veteran pitchers do what they've always done, which is take pride in their ability to make their turn in the...