Ali finished with 137 yards on 18 carries. Cam Fancher threw for 268 yards with a touchdown and an interception.
Ali's 13-yard run late in the third quarter cut the Herd's deficit to 17-14. He broke free on a fourth-and-1 early in the fourth quarter for a 30-yard score and the lead.
Aamir Hall later gave Albany the ball at the Marshall 46 with an interception but the Great Danes turned the ball over on downs at the Herd 26. Albany got the ball back again with a blocked field goal with 2 1/2 minutes left but Reese Poffenbarger was sacked on consecutive plays and turned the ball over on downs around midfield.
Poffenbarger threw for 194 yards and a touchdown.
Albany opened with a 34-13 win over Fordham last week and had a school-record 10 sacks. But the FCS Great Danes only had one against the Herd while surrendering seven.
The victory was the 600th collegiate win for Marshall, which early in its football history played some games against semipro, YMCA or high school teams. Its first collegiate win came in 1903.
AP college football: https://apnews.com/hub/college-football and https://apnews.com/hub/ap-top-25-college-football-poll
Copyright 2023 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.