The Phillies, who are 2½ games behind NL East-leading Atlanta, have lost three straight to the going-nowhere Astros. They've missed an opportunity to gain ground on the Braves, who've lost three in a row to Colorado.
Happ (4-2) allowed two runs and five hits in 6 1-3 innings, becoming the second former Phillies pitcher to beat them in this series. Brett Myers did it Monday.
Happ won 12 games for Philadelphia as a rookie last year, then was traded to Houston last month for ace Roy Oswalt.
Halladay (16-9) gave up three runs and six hits in seven innings, snapping his six-game winning streak.
Michael Bourn and Hunter Pence hit solo homers for the Astros, who are the only NL team with a winning record (29-16) against the Phillies since 2004.
Brandon Lyon tossed two scoreless innings for his eighth save in nine chances. He struck out pinch-hitter Domonic Brown to end it after allowing a two-out single to Ryan Howard.
Jayson Werth hit a solo shot for Philadelphia, which has scored two runs or less in six of the last seven games.
For the third straight night, a disputed call by the umpires was a factor in the outcome. With Jimmy Rollins batting, runners at first and third and the Phillies down a run in the seventh, catcher Humberto Quintero picked Ben Francisco off third base to end the inning.
Francisco appeared to get his foot tangled up with third baseman Chris Johnson's foot and was called out by third base umpire Greg Gibson. Third base coach Sam Perlozzo and manager Charlie Manuel argued, but neither was ejected.
On Monday night, Manuel got tossed by Gibson for arguing Bourn should've been called out of the baseline running to first on a bunt single. Bourn went on to score the deciding run.
In the 14th inning of Tuesday night's 4-2 loss in 16 innings, Howard was ejected after third base umpire Scott Barry called him out on a checked swing. The Phillies wound up putting Oswalt in left field and Raul Ibanez at first base.
Barry was booed loudly during pregame introductions, and Gibson got an earful after his call in the seventh.
Quintero hit a two-out single in the seventh to give the Astros a 3-2 lead. Chris Johnson doubled and scored on Quintero's liner to left.
Halladay singled and scored the tying run in the sixth on Placido Polanco's double over left fielder Carlos Lee's head.
But Happ escaped further trouble with runners on second and third by retiring Chase Utley on a popup and Werth on a grounder. Werth's batting average of .157 with runners in scoring position is the worst in the majors.
Bourn put the Astros up 2-1 in the sixth when he hit one out to right for just his second homer this season.
Halladay, who threw the 20th perfect game in history on May 29 at Florida, retired the first 11 batters before Pence connected in the fourth for a 1-0 lead. It was the first run Halladay allowed in 18 innings.
Happ hadn't allowed a hit until Werth lined one just over the left-field wall in the fifth.
Howard wasn't in the starting lineup a night after his second career ejection. He's 3 for 20 with 10 strikeouts since returning from an ankle injury.
Notes: Oswalt said he never played left field in his life before entering in the 15th inning on Tuesday and catching a fly ball. He played shortstop and pitched in youth ball. ... Pence has 10 homers in 22 career games against Philadelphia. ... A crowd of 44,657 was the 106th straight sellout at Citizens Bank Park. ... Quintero leads the majors with six pickoffs.