Gaines caught a 1-yard toss with 6:56 to play to give the Bills (1-3) a 17-7 lead and put them on their way to their first win of the season.
Edwards completed 22-of-28 passes for 234 yards, while Marshawn Lynch ran for 79 yards on 23 carries -- including a 10-yard run up the middle to open the scoring in the third quarter following a scoreless first half.
Jets quarterback Chad Pennington was 32-of-39 for 290 yards, one touchdown and an impressive 82 percent completion rate.
Pennington threw a 5-yard touchdown strike to Laveranues Coles to make it 7-7 with 2:13 to play in the third quarter. The Bills answered with a 46-yard field goal by Rian Lindell and Gaines’ touchdown catch.
New York added an 8-yard touchdown run by Leon Washington to close out the scoring with 3:02 to play in the game.