The Texans (4-1) led 20-3 after a field goal early in third quarter before the Bills scored 17 straight points to tie it with about 3 minutes to go.
Stroud was called for intentional grounding to bring up fourth-and-15 and take the Texans out of field-goal range with less than a minute left.
A punt backed the Bills up to their 3 and they punted after three straight incomplete passes to give Houston one last chance.
Dare Ogunbowale had a 5-yard run to set up Fairbairn's game winner.