Panik's tiebreaking three-run shot off Jose Urquidy gave Toronto a 4-1 lead in the fourth inning. Guerrero connected in the fifth, sending a two-run drive deep to left for his 18th homer.
Guerrero finished with three hits, raising his batting average to .338. The 22-year-old first baseman also cut down Jose Altuve at third base in the first inning and scored from second on a Lourdes Gurriel Jr. single in the fourth.
''Whatever I have to do for the team to win, I'll do that,'' Guerrero said through an interpreter. ''I'm not thinking or paying attention to (statistics). It's a long season and you never know what can happen. I'm focused at the moment, and just trying to keep producing and help the team win.''
''The way he's playing first and the way he's hitting, he's one of the best players in baseball right now,'' Toronto manager Charlie Montoyo said.
Ross Stripling pitched five innings of one-run ball for the Blue Jays, who improved to 3-1 at their temporary home in Buffalo. Stripling (2-3) allowed seven hits, struck out four and walked one.
Carlos Correa had three hits for the Astros, who won 13-1 in the series opener Friday night. Myles Straw drove in two runs.
Urquidy (4-3) was tagged for a season-high six runs in 4 1/3 innings. He allowed two or fewer earned runs in seven of his previous nine starts this season.
''He was finding too much of the plate,'' Astros manager Dusty Baker said. ''He was throwing almost too many strikes. You hit the heart of the plate, something bad's going to happen.''
Toronto's bullpen, an area of concern in recent weeks, put together a solid day. Tim Mayza got three outs before Trent Thornton worked two scoreless innings. Rafael Doliz allowed a run in the ninth before closing it out.
''Pitching and defense wins in the big leagues,'' Montoyo said. ''When you play teams like that, you have to play flawless and play your `A' game. We pitched good, played defense, and of course, we hit.''
ASTROS STARTING STRONG
Even with Urquidy's tough day, Houston starters have combined for a 2.56 ERA over the last 10 games.
The Blue Jays have utilized 25 pitchers this season, second-most in the American League behind Seattle's 28. Toronto's 13 different starting pitchers in 2021 are the most in the majors; four teams have used 11.
Astros: INF/OF Aledmys Diaz departed after being hit on the back of his hand by a 92-mph pitch from Stripling in the fourth inning. He was having X-rays done to assess the extent of his injury, but Baker had no update on the results.
Blue Jays: OF George Springer (quad strain) had what Montoyo described as ''the best day he's had'' in working toward a return. ''He did everything 100%,'' Montoyo said. ''Now he's looking better to start rehab games.'' Montoyo provided no timetable for that step, but did indicate that his rehab assignment would be with Triple-A Buffalo, which is playing its home games in Trenton while the Blue Jays reside in western New York.
The series concludes Sunday with Astros RHP Luis Garcia (4-3, 2.89 ERA) facing Blue Jays LHP Steven Matz (6-2 4.22 ERA).
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.