Updated

PITTSBURGH (AP) — Pedro Alvarez's sacrifice fly in the eighth inning drove in the go-ahead run and the Pittsburgh Pirates withstood Carlos Santana's big game to beat the Cleveland Indians 5-3 Sunday.

Pittsburgh won its second in a row in the matchup of last-place Central Division teams after dropping 12 in a row — one short of the club's modern-era single-season record — and 18 of 21. The Pirates lost their first seven interleague games before winning 6-4 Saturday.

Cleveland dropped its sixth in seven games despite Santana's three hits, including a two-run home run in the first and an RBI double in the third. Santana was 5 for 5 in the series until he struck out looking on an inside pitch in the seventh.

Andrew McCutchen walked to reach base for the seventh time in two games leading off the eighth against reliever Jensen Lewis (2-2) and Garrett Jones singled ahead of Lastings Milledge's sacrifice bunt. Alvarez, 1 for 16 since his callup on Wednesday, scored McCutchen with his long fly ball to right and Bobby Crosby singled in Jones with his third hit.

Octavio Dotel pitched the ninth for his 14th save in 17 opportunities after Brendan Donnelly (3-1) retired three consecutive batters with runners on second and third in the eighth.

Austin Kearns singled and Russell Branyan doubled down the right field line — Pirates manager John Russell was ejected for arguing the call was foul — to start the eighth. Both runners held on Jhonny Peralta's fly ball to midrange center and Anderson Hernandez and Jason Donald grounded out.

Indians starter Justin Masterson shook off some shaky defense — including some of his own — while the Pirates scored two runs in the first inning, then shut out Pittsburgh on two singles over the next five innings.

Jose Tabata beat out an infield single, moved to second on third baseman Peralta's error and Neil Walker singled. Masterson then threw wildly on McCutchen's slowly hit ball, with Tabata scoring and McCutchen credited with an RBI, and Jones singled in a run to extend his hitting streak to 11 games.

Masterson struck out seven and walked one after giving up seven runs and 10 hits in seven innings during a 7-6 loss to the Mets on Tuesday.

That shaky Indians defense resurfaced in the seventh. Ramon Perez charged with an errant throw on Crosby's bunt before throwing a run-scoring wild pitch that tied it at 3.

Lincoln made the best of his three major league starts, permitting eight hits and three runs in his third consecutive six-inning start. He gave up five runs in each of his first two starts.

NOTES: Cleveland left 11 on base. ... The Pirates went 2-3 during their homestand. They are 16-19 at PNC Park, where they play only four of 19 games until the All-Star break. ... Pirates LHP Jack Taschner refused a minor league assignment and became a free agent. ... Russell, who is rarely demonstrative, was ejected for the second time this season and the fourth time in his three-season managerial career.