The Giants overcame some late mistakes and clinched their first winning season since 2016.