Dallas Keuchel pitched seven strong innings for the Astros. Keuchel (1-1) allowed one run and five hits, walked two and struck out six.
Villar hit a three-run homer, Robbie Grossman had a two-run shot and Jason Castro added a solo shot as the Astros won for just the second time in eight games.
Villar connected on the first pitch he saw from Dickey in the seventh inning for his second of the season.
Grossman homered on a 3-0 pitch from Dickey in the fifth for his first of the season.
Castro connected off reliever Esmil Rogers to begin the eighth for his second of the season.
After Chad Qualls worked a scoreless eighth, the Astros struggled to close it out in the ninth.
Josh Fields got two outs, but left after pinch hitter Adam Lind's two-run double. Anthony Bass came on and got Melky Cabrera to hit a grounder, but Bass' high throw to first allowed Lind to score. Maicer Izturis ended it by grounding to the mound, giving Bass his first save.
Colby Rasmus hit his first home run of the season for Toronto, a solo drive in the fifth.
Dickey (1-2) was moved up a day to face Houston on regular rest, with right-hander and fifth starter Dustin McGowan moved back to start Friday's game at Baltimore. Dickey allowed five runs and six hits in seven innings. He walked three and struck out four.
The Astros prepared to face Dickey by taking swings in an indoor cage before the game against former major league knuckleballer Steve Sparks, now a Houston radio announcer.
It's the same strategy manager Bo Porter employed before his team faced Dickey in Toronto last July 27. In that game, Houston had five runs and seven hits off Dickey in six innings, but couldn't hold a lead and lost 12-6.
On Thursday, Dickey walked two batters but didn't allow a hit through the first three innings, a streak that ended when Castro singled to begin the fourth.
Marc Krauss doubled to begin the fifth and, one out later, Grossman homered.
Rasmus cut the lead in half in the bottom of the inning, but Houston chased Dickey with a three-run seventh. Matt Dominguez hit a one-out double, Grossman walked and Villar followed with a drive to center.
Dickey allowed a career-worst 35 home runs in 34 starts last season, the second-highest total in the majors behind Oakland's A.J. Griffin (36). Dickey had not allowed a homer in his first two starts this season.
NOTES: Cabrera doubled twice, extending his hitting streak to 10 games. ... Blue Jays LH J.A. Happ (back) allowed one run and four hits in 4 2-3 innings in a rehab start at Triple-A Buffalo. Happ walked two and struck out six. ... Toronto RH Steve Delabar, who left Wednesday's game after being struck on the right calf by a line drive, was not available. X-rays on Delabar's leg were negative, manager John Gibbons said. ... Astros RH Jerome Williams, who left Wednesday's game with a strained right groin, felt better Thursday, Porter said. ''He's much better than the trainers anticipated,'' Porter said. ... Toronto begins a three-game series at Baltimore Friday, with McGowan (0-1) facing Orioles RH Chris Tillman (1-0). ... The Astros visit Texas on Friday, with RH Scott Feldman (2-0) facing RH Yu Darvish (1-0).