ST. LOUIS (AP) Pedro Alvarez homered in a seven-run first inning and the Pittsburgh Pirates broke an eight-game losing streak at Busch Stadium, beating the St. Louis Cardinals 10-5 Thursday night.

The Pirates moved within six games of the first-place Cardinals in the NL Central with their 12th victory in 18 games.

St. Louis, which won the first two in the series, has won the last seven sets between the teams at Busch Stadium.

More from FoxSports

Alvarez had three hits as the Pirates held on. The Cardinals closed their seven-run deficit to 7-5 in the seventh.

Francisco Liriano (8-6) pitched six innings.

Lance Lynn (9-7) got just two outs in the shortest of his 119 career starts.