PITTSBURGH (AP) The Los Angeles Dodgers were in deep trouble before Scott Kazmir settled down and the lineup went to work.
A.J. Ellis capped Los Angeles' four-run fifth inning with a tiebreaking RBI single with two out, helping the Dodgers rally for a 5-4 victory over the Pittsburgh Pirates on Monday.
Los Angeles was looking at a four-game sweep by Pittsburgh after the Pirates scored four in the first. But Kazmir responded with four scoreless innings from there, giving the Dodgers a chance.
''It was resiliency,'' manager Dave Roberts said. ''We spot them four in the first, and (Kazmir) goes out there and throws up four zeroes and we responded, put up a crooked number and found a way to win a baseball game.''
Pirates left-hander Francisco Liriano (4-8) carried a two-hitter and a 4-1 lead into the fifth, but he was chased by Yasiel Puig's two-run single.
Howie Kendrick greeted Jared Hughes with an RBI single, and Puig took third on a throwing error by catcher Erik Kratz. Kendrick stole second, Scott Van Slyke struck out and Ellis drove in Puig with a grounder to the outfield grass in the shortstop hole, giving the Dodgers their first lead of the series.
Kazmir (6-3), who entered with an 11.17 ERA at PNC Park, retired 12 in a row after Kratz's two-run single made it 4-0 in the first. The lefty allowed four hits, struck out four and walked four.
''He was a completely different guy on the mound,'' Pirates manager Clint Hurdle said of Kazmir's turnaround.
Kenley Jansen, the Dodgers' sixth pitcher, got four outs for his 22nd save in 25 chances.
''I just wanted the ball, especially with us losing three games straight,'' Jansen said. ''I wanted to ask for five or four (batters). My teammates had been eating a lot of innings lately. I just wanted to help them out.''
Before Jansen entered, Louis Coleman, J.P. Howell, Joe Blanton and Pedro Baez combined for 2 2/3 innings of one-hit relief.
For Liriano, the struggles are nothing new, particularly with his command. He issued five walks and leads the NL with 59 - 13 more than Miami's Tom Koehler, who is second.
Starling Marte got Pittsburgh on the board with an RBI single and Sean Rodriguez drove in a run with a bases-loaded walk. Justin Turner started Los Angeles' comeback with a sacrifice fly in the third.
Pirates: OF Gregory Polanco did not start for the fourth straight game due to a left leg injury. He pinch-hit for the second consecutive game, striking out in the ninth.
Dodgers: LHP Julio Urias (0-2, 4.33 ERA) gets the ball when Los Angeles begins a three-game series in Milwaukee on Monday.
Pirates: LHP Jonathon Niese (6-5, 4.93 ERA) will start the opener of a two-game series at Seattle. Niese has given up four runs or more in three consecutive starts.