HOUSTON -- The Cubs' luck may have finally changed.

Ryan Dempster survived a nail-biting ninth and Cliff Floyd homered to back Rich Hill to boost the Cubs to a 3-2 victory over the Houston Astros Wednesday night. Chicago is back in a tie for first place with the Milwaukee Brewers in the National League Central.

"This really should get us on a roll," Cubs manager Lou Piniella said. "You have to think the worm has turned."

Hill (9-8), who ranks last in the Majors in run support, got just enough. The left-hander struck out seven, walked three, and gave up three hits, including Mark Loretta's leadoff homer in the seventh, to post his 16th quality start of the season.

"It was a pressure game for him to pitch in and he responded as well as or better than expected, and I was extremely proud of him," Piniella said of the lefty.

"Every game's a big game," Hill said. "The next game will be even bigger. As long as you go out there and throw with conviction and confidence, things will work out."

That's Dempster's motto. With the Cubs leading, 3-1, Loretta singled to lead off the Astros ninth, but instead of a routine two, three-hopper to first baseman Derrek Lee, the ball deflected off the first-base bag into shallow right.

OK, be honest, who wasn't thinking, 'Here we go again'?

"Honestly? I'd much rather have no luck than that kind of luck," Dempster said of the freak bounce.

"That's just a fluke and there's nothing you can do about that," Lee said. "It was kind of funny. How many times do you see that?"

Pinch-hitter Mike Lamb then dropped an RBI triple into the gap in right-center to close to 3-2. One out later, Dempster walked pinch-hitter Orlando Palmeiro, prompting a visit from Piniella. Eric Munson was up, and Piniella's only message was that he was a perfect double play candidate.

"I told him, 'Get this guy to hit it on the ground and we've got a chance,'" Piniella said.

Munson bounced the ball to Lee, who got off the bag quickly and made a perfect feed to shortstop Ryan Theriot, who then fired to Dempster covering at first.

"It's the way you work it up in Spring Training," Piniella said.

"I stopped it with my hand," Lee said, "and when I knew I stopped it, I had time."

"You practice those things, and don't forget about those things," Dempster said. "A simple thing like covering first sealed the deal. It was nice to remember to get over there and be there for the throw and step on first. I didn't know where it was -- I stepped in the middle and was worried he was going to blow my ankle out."

But he didn't, and Dempster picked up his 26th save, and hopefully the Cubs picked up some momentum. With the win, the Cubs and Brewers both boast 74-71 records, and are tied for first for the ninth time.

If the Cubs needed any motivation, all they had to do was look at the scoreboard in left field at Minute Maid Park. Pittsburgh 7, Milwaukee 4.

"These kids, they don't want to lose baseball games," said Piniella, who was still simmering about Tuesday's 5-4, 11-inning loss to Houston before Wednesday's game. "They weren't happy [Tuesday] night. I wasn't happy [Tuesday] night. Nobody was happy.

"At the same time, we didn't get it done," he said. "The team in front of us lost this afternoon. There's the score. Let's go out and get one and get back on top. That's the way you have to look at this thing -- no other way. Forget yesterday."

That's just what the Cubs did.

"You have to realize that just because the odds are stacked against you, you can always make a pitch and get out of it," said Dempster, who took the loss on Wednesday. "Sometimes it doesn't happen. There's always tomorrow. You saw how frustrated I was and how angry I was. You have to come in the next day and be ready to go."

Floyd had motivation, too. Piniella tabbed him as his "Pick to Click" before the game, borrowing a phrase from White Sox announcer Hawk Harrelson. Floyd responded, leading off the second with his sixth home run of the season and second since the All-Star break, connecting on a 1-1 pitch from Matt Albers (4-8). Mark DeRosa then singled and reached third on a perfectly executed hit-and-run single by Jason Kendall before scoring on Theriot's sacrifice fly to make it 2-0.

Floyd tripled to lead off the fourth, his first since May 21, 2006, when he did so for the New York Mets against the New York Yankees in an Interleague game. Two outs later, Theriot drove Floyd in again, this time with an infield single to Loretta at short.

Floyd did admit he was thinking about hitting for the cycle after his first two at-bats.

"The hardest part for me right now is to get a triple," he said. "Once I got that out of the way, I thought it'd be great to do something special."

It was special enough.

There were other defensive highlights, such as Alfonso Soriano notching his 15th assist when he threw out Hunter Pence at third base in the eighth.

"Tonight was a big game for us, and the way we came together as a team and pulled for each other was huge," Hill said.

The mood in the clubhouse was a complete reversal from Tuesday. Piniella could probably do without the dramatic endings.

"As long as we score one more than the other team, and I have enough Maalox, I'll be fine," he said.