Eli Manning engineers late comeback to get win over 49ers