LOS ANGELES -- Manager Lou Piniella told the Cubs after Saturday's game that things have to get better. For one day, they did.

Rookie Jake Fox went 4-for-4, including a solo homer and RBI single, to back Ryan Dempster and lift the Cubs to a 3-1 victory Sunday over the Los Angeles Dodgers, avoiding a sweep.

"We needed to win a ballgame," Piniella said. "We pitched really well and hit just enough. Hopefully, back home, we can have a really good homestand and we'll see. It's there for us. We'll see what we do."

The Cubs won for just the fifth time in their past 17 games and finished the West Coast trip 2-5. The St. Louis Cardinals didn't let up, beating San Diego on Sunday to maintain an eight-game lead in the National League Central. The Cubs trail Colorado in the NL Wild Card by seven games.

"We need to start scoring runs," Piniella said. "Like I told the team [Saturday] night after the game, it's got to turn, it's got to get better. Just relax and don't give in to it."

The one constant has been the starting pitching, and Dempster (7-7) continued that as he posted the team's 75th quality start of the season and fifth in the past seven games. On this road trip, the Cubs starters compiled a 2.01 ERA. Dempster struck out five and held the Dodgers to three hits over seven-plus innings.

"Dempster set the tone," Piniella said.

The key?

"Breakfast," Dempster said. "I had a good combination of pancakes and a little bowl of 'Whup your [backside]' cereal."

OK, seriously now, what worked?

"I threw the ball over the plate and those guys made the plays behind me," Dempster said. "When you get ahead of hitters, especially a lineup like that, they don't ever give you a break and you have to try to pound the strike zone as much as possible. I felt I did that today and mixed speeds."

"Dempster was good all game," Dodgers manager Joe Torre said. "He's been good against us, he knows how to pitch, he throws a lot of strikes."

The right-hander was pulled after walking Russell Martin to start the eighth. John Grabow took over, and the Dodgers had runners at first and third and one out, and pinch-hitter Orlando Hudson popped up. Shortstop Ryan Theriot lost the ball in the sun, and it dropped, but third-base umpire Wally Bell had called time before the play. The reprieve helped. Grabow got Hudson to hit into an inning-ending double play.

"I saw the third-base umpire coming in before the pitch," Piniella said. "My emotions were, 'Boy, what a bad break,' and then, 'What a good break.' I told Theriot on a play like that, concede the run and get a force at second."

Grabow said he heard Bell yelling but didn't know why. The Dodgers wanted to insert a pinch-runner at first. The lefty did pump his fist after the double play was completed.

"It's a game that we have to win," Grabow said. "'Demp' went out and threw a great game and we got some runs. It's a good note to end on, and for me, it's nice because it's my hometown and to do it in front of family, we'll take it."

Carlos Marmol, in a save situation for the first time since being named closer over Kevin Gregg, retired the side, and got Manny Ramirez looking at strike three to end the game.

"It was good to see him in that role," Piniella said.

"It felt good," Marmol said.

The four hits were a career high for Fox, starting in place of Alfonso Soriano, who is nursing a sore left knee. The rookie smacked his ninth homer with one out in the second off starter Chad Billingsley (12-7), the first time the Cubs had a lead in this series.

However, Fox may not be in the lineup Tuesday when the Cubs open a 10-game homestand against Washington.

"I said I'll play my veteran players and they're going to have to get it done," Piniella said. "I'll lean as much as I can on the veteran players here and see what they can do and how far we can go."

Fox understands.

"When I come in here, I don't know what my job will be every day, but whatever job [Piniella] asks me to do, I'll do to the best of my ability," Fox said. "It was cool to be out there today and be part of that win."

The Dodgers tied the game in the second when Matt Kemp was safe on a throwing error by Aramis Ramirez and scored on Tony Abreu's single. But Aramis Ramirez tripled to open the sixth, getting an assist from the wall in left as the ball ricocheted out of Manny Ramirez's reach. Kosuke Fukudome followed with a double and then scored on Fox's RBI single. That was enough.

"This game is a good game to build off of," Fox said, speaking of the team, not himself. "We went through a rough patch but we're not out of it, we're not folding it up. We're going to keep playing hard and keep playing with the same energy. I think there's some good baseball ahead of us."