The Lions scored four touchdowns in the opening quarter and still found themselves trailing in the final period when Buffalo's Marcus Easley returned a kickoff 100 yards for a score and caught a 2-point conversion pass from Tyler Thigpen.
Detroit then marched 80 yards in eight plays to the winning touchdown.
The Lions' big first period consisted of a 24-yard touchdown pass from Matthew Stafford to Calvin Johnson, scoring runs of 2 yards by Mikel Leshoure and 1 yard by Shaun Hill and a 23-yard interception return by Jonte Green.
Moore completed 17-of-30 passes for 211 yards after Stafford saw only brief duty in the first period.
Thigpen was 18-of-30 for 186 yards with a touchdown and two interceptions.
There were three teams that failed to win a preseason game in the NFL this year and all of them are from the AFC East. Buffalo joined the New York Jets and Miami with winless records. The Jets will host Buffalo to open the regular season.
Detroit (2-2) will begin its season at home against St. Louis.
Swim Week Miami Beach 2014 [PHOTOS]