The Cardinals improved to a majors-best 31-11 at home with their second successive win following a four-game losing streak. San Diego has lost five of seven.
Pham was called up from Triple A on Friday and starred in his third big-league start. He hit his first homer, a two-run drive off Ian Kennedy (4-8) in the third. Pham doubled home Lynn in the fifth.
Lynn (6-4) gave up three hits and one unearned run in seven innings. He also doubled and singled for his first career multihit game and scored twice.
Lynn struck out eight and retired 11 in a row at one point. He has not lost in his last six starts.
Matt Kemp drove in the Padres' run with a single in the third.
Kennedy gave up three runs on seven hits over six innings.
Pham scored both runs in a 2-1 win on Saturday. His homer Sunday came on a 370-foot line drive that barely cleared the wall in left-center field, and Pham temporarily stopped at second base, believing it was a ground-rule double.
The Cardinals wrapped up a nine-game homestand with a 5-4 mark.
San Diego has scored four runs in its last three games.
Cardinals: LHP Jaime Garcia was put on the 15-day disabled list with a groin strain sustained while running the bases against Miami on June 24. LHP Tim Cooney was recalled from the minors and will start on Tuesday against the Chicago Cubs.
Padres: RHP James Shields (7-3, 4.14) will start the first of a three-game series in Pittsburgh against RHP A. J. Burnett (7-3, 2.05).
Link to box score: St. Louis (53-28) 3, San Diego (39-45) 1