Saints rally for win over Niners in slugfest