Gostkowski's clutch kick in the season opener came after Tom Brady led the Patriots on a 12-play, 49-yard drive with time winding down. He connected with Danny Amendola on two key third-down passes during the last-chance effort.
Brady went 29-of-52 through the air for 288 yards and two touchdown passes to Julian Edelman.
Shane Vereen provided 101 rushing yards and 58 receiving yards while Amendola ended with 10 grabs for 104 yards as the Patriots (1-0) won a 10th straight season opener.
EJ Manuel completed 18-of-27 passes for 150 yards and two touchdowns in his NFL debut for the Bills (0-1).