Buehrle (10-7) limited the Astros to one run on seven hits over eight innings, walking two and striking out seven.
He left with Toronto trailing 1-0, but the Blue Jays began a comeback when Brett Lawrie opened the ninth with a walk from Chia-Jen Lo (0-2) and pinch-hitter Adam Lind singled.
Anthony Gose came in to run for Lind and Lo issued consecutive walks to pinch-hitter Munenori Kawasaki and Moises Sierra to force in Lawrie with the tying run.
Then, with Kevin Chapman on the mound, Ryan Goins grounded out, driving in Gose with the winning run.
Casey Janssen closed out the win with his 23rd save as the Blue Jays avoided a three-game sweep.
Astros starter Dallas Keuchel tossed seven shutout innings, allowing four hits.