The loss snapped the Rangers' four-game winning streak, but they were still 4-2 on the homestand.
"That other team didn't stop fighting, and we didn't either," Rangers manager Ron Washington said. "We fought hard. I thought we could take the wind out of their sails, but we didn't. That's the way it goes."
The Rangers played from behind all night. Robinson Tejeda started the game by giving up singles to Craig Biggio and Hunter Pence, and then Lance Berkman put the Astros ahead with a three-run home run over the right-field fence.
That gave the Astros a 3-0 lead and the Rangers spent the rest of the night trying to run them down. It didn't help that starter Robinson Tejeda was gone after 3 2/3 innings, giving up seven runs (five earned) on five hits and four walks.
Tejeda now has a 9.58 ERA with opponents hitting .348 off him in his last seven starts.
"I've had a couple of bad starts, but it's nothing I can't fix," Tejeda said. "All I can do is keep working, and it's going to change. Nothing was working tonight. My breaking ball wasn't working. I lost control of my fastball. I was working behind in the count a lot. I just have to get it back together."
Tejeda left trailing, 7-2, but was spared another loss on his record because of his teammates. The Rangers were down 7-3 in the bottom of the eighth but came back to tie the game on a two-run single by Sammy Sosa and a two-run home run from Frank Catalanotto.
The Rangers couldn't keep it tied in the ninth even though Washington went with Gagne, who had allowed just one run in 20 innings this season. He gave up twice as many in the course of just four batters.
Hunter Pence led off with a double, and Lance Berkman walked. Carlos Lee flied to deep center, moving Pence to third. Mark Loretta worked the count full and ripped a line drive to center. The ball bounced in front of center fielder Kenny Lofton, who was charging hard for a play at the plate. The ball took a wicked spin past him.
Both runners scored and the Astros led 9-7.
"I felt really good," Gagne said. "I felt great. I just didn't make my pitches. They were sitting on my changeups, and I didn't make adjustments. They swung the bats good. It happens."
The Rangers still didn't give up. Instead they tied it up in the bottom of the ninth. Marlon Byrd led off the inning with a home run off Astros reliever Dan Wheeler, and Ian Kinsler pulled the Rangers even with a two-out home run.
Again, the Rangers couldn't keep it tied. Wilson (0-1) entered the game having allowed just two runs in 14 2/3 innings over his last 13 outings and promptly gave up three runs.
Pinch-hitter Morgan Ensberg led off the inning with an infield hit off third baseman Ramon Vazquez's glove and was bunted to second by Eric Bruntlett. Craig Biggio, holding off on an 0-2 pitch that Wilson thought was strike three, doubled home Ensberg to put the Astros ahead. The Astros added two more with the help of singles by Pence and Berkman, a walk to Lee and a forceout.
"There are about eight things that went wrong," Wilson said. "The Ensberg ball took a funny hop. On Biggio, it was strike three right down the middle. They called it a ball. ... It was just kind of a weird way to lose."
The Rangers still finish Interleague play at 11-7, their most wins against a National League team in one season.
"I would have loved to have won the game," shortstop Michael Young said. "You just have to give the Astros credit. They scored the runs late. Our bullpen is not going to be perfect. It just shows you how good they've been all year that we're even talking about this."