The win snapped a season-worst four-game losing streak and gave Pittsburgh a three-game lead in the NL Central.
The Pirates had a five-run cushion after four innings against rookie Shelby Miller, who didn't miss a turn five days after getting drilled on the elbow and lasting just two pitches against the Dodgers. They're 8-4 against the Cardinals heading into the series finale matching A.J. Burnett and Lance Lynn.
Pittsburgh totaled just 10 runs during the losing streak and won in 2 hours, 30 minutes one night after losing 4-3 in 14 innings in a game that lasted 4:55.
Liriano (13-5) allowed four hits with six strikeouts and needed just 94 pitches to beat the Cardinals for the second time this year. He is 3-0 in his career against St. Louis. His last time out, the lefty was punished for 10 runs in 2 1-3 innings at Colorado.
Alvarez hit his 29th homer an estimated 440 feet to straightaway center leading off the second against Miller (11-8), and with one out Jones lined his 11th over the right field wall estimated at 392 feet. Starling Marte's two-run double capped a three-run fourth, with two of the runs unearned due to fielding error by third baseman David Freese.
Miller gave up two homers for the fourth time and has lost all of those starts, twice against Pittsburgh. In six innings, he gave up five runs, three earned, on eight hits.
Liriano retired the side in order six times, twice with the help of double plays. A third double play helped him escape without damage in the second when the Cardinals got two of their hits.
In the three starts prior to his clunker at Colorado, Liriano allowed one earned run over 21 2-3 innings in winning three straight starts.
The Cardinals are 3-6 with one game to go on a 10-game homestand that began with series losses to the Cubs and Dodgers.
Notes: The Pirates have outscored the Cardinals 14-2 in Liriano's two starts this year. ... Tabata missed his second straight start but entered as a defensive replacement in right field in the eighth. He was scratched with flu-like symptoms Tuesday. ... The Cardinals left a season-high 17 runners on base Tuesday night. ... Matt Holliday has 17 hits during an 11-game hitting streak but also grounded into his major league-leading 27th double play. He also lined into a twin killing in the fourth. ... Nine of the homers off Miller have come with the bases empty.
Link to box score: Pittsburgh 5 at St. Louis 1
Link to game discussion at The Cardinal Nation message board