The Indians (5-6, 3-4 Sun Belt Conference) got a chance for the victory after Thomas Moreland missed a 26-yard field goal with 1:18 left.
Arkansas State, which never led until the end and trailed 21-0 at one point, drove 80 yards for the winning score.
The touchdown pass was the 16th this season by Leonard, setting a school record. Leonard completed 25 of 50 passes for 305 yards and two touchdowns with two interceptions. He also rushed for 52 yards.
Moreland converted fourth-quarter field goals of 28 and 37 yards to keep the Mean Green (1-9, 1-5) in the lead after the Indians had closed to within 21-17 in the third quarter. His last field goal gave North Texas a 27-17 lead with 7:08 to play.
Arkansas State's comeback began with Leonard finding J.T. Jordan for a 6-yard touchdown pass with 5:15 to play.