The Dodgers reached a season-best 28 games over the .500 mark on Sept. 3 and since then have gone 8-13 as they head for the playoffs.
Los Angeles took a early 2-0 lead, but San Francisco tied it in the fifth with the runs scoring on a ground out by Pagan and a double by Brandon Belt.
Pagan opened the eighth against Paco Rodriguez (3-4) and swung and missed at the first two pitches. He then launched his fifth home run of the season to left.
Wisconsin business offering 'therapeutic cuddling' forced to close
Costly malfunction causes beer flood at Boston-area brewery