The Thundering Herd (1-3) led 24-17 when Anderson threw a 12-yard touchdown pass to Antavious Wilson with 8:21 left in the fourth quarter. Anderson, who finished with 295 yards passing, also had passing scores of 45 and 7 yards.
Ohio's Boo Jackson connected with Terrence McCrae on a 36-yard touchdown, cutting the lead to 24-23 with no time left. The Bobcats (1-3) elected to go for the two-point conversion, but Jackson's pass sailed through the back of the end zone to secure Marshall's win.
Wilson caught seven passes for 119 yards, including a touchdown catch in the first quarter for the Thundering Herd.
Jackson threw for 155 yards and one interception for Ohio, which lost for the sixth straight time against Marshall.