Smelley completed 19-of-37 passes for 279 yards with an interception for the Gamecocks (4-1, 2-1 SEC), who trailed after three quarters.
Davis, who scored twice in the final quarter, rushed for 59 yards on 18 carries. Cory Boyd rushed for 58 yards on 11 rushes for South Carolina. Kenny McKinley made four receptions for 107 yards and two TDs.
Josh Riddell had 101 yards with a touchdown and an interception on 9-of-21 passing for Mississippi State.
Anthony Dixon ran for 83 yards and a two touchdowns for the Bulldogs (3-2, 1-2), which had won three straight.