The Pirates had lost 10 straight to the Cubs and were 0-7 against them this year before McLouth came through with the big hit.
Freddy Sanchez beat shortstop Ryan Theriot's throw to first on a grounder up the middle with one out before McLouth's drive off Marmol (1-1) to the basket above the right-field wall. Pittsburgh won for the ninth time in 12 games.
"Against a guy like that who has electric stuff as he has, you don't try to do too much," McLouth said. "You just try to put the ball in play because he's got incredible stuff."
He got a fastball and drilled his 12th homer and his second off Marmol, who had pitched 13 consecutive scoreless innings.
"You're not perfect," said Marmol, who has allowed two homers. "You're going to make mistakes."
Soriano has 20 hits in his last 37 at-bats, raising his average to .295 after a brutal start.
He tied a career high by leading off his fifth straight game with a hit when he lined a single to center and added an RBI single during a three-run second that gave the Cubs a 3-1 lead.
His solo shot to left off Zach Duke in the fourth made it 4-2, and he greeted Yates with another one that tied it at 5 in the seventh. That gave him seven homers in the week and 10 for the season. It was the second time he hit two homers in back-to-back games, the first coming for Texas against Cleveland on May 6-7, 2005. And he became the first Cubs player with back-to-back multihomer games since Ramirez at Washington on July 21-22, 2006.
The five-hit game was Soriano's first since June 4 against Milwaukee, and his career-high is six for Texas against Detroit on May 8, 2004.
"I'm very confident in myself," said Soriano, who spent the last two weeks in April on the disabled list with a strained right calf. "I had a bad month in April. I said when I come back, I want to come back strong."
And that's exactly what he did.
"Some people think he's a dumb hitter but he's not," Cubs starter Carlos Zambrano said. "He's a smart hitter and at the beginning, people booing him were doing no good. Everybody in baseball can go through slumps, bad times. Superstars do what Sori's doing right now."
Duke, who won his previous two starts, gave up four runs and eight hits in 6 1/3 innings.
He left after Nady made a diving catch near the right-field warning track to rob pinch hitter Ronny Cedeno. Then, Soriano went deep off Yates.
"He's locked in right now," Duke said. "It seems like you can throw him a pitch in any location and he's going to hit it hard."
Zambrano was in line for his second loss of the season before Soriano's second homer. After going 5-0 in his previous six starts he simply didn't have it. He left with none out in the fifth and the game tied at 4 after lasting at least six innings in his first nine outings.
Duke led off with a walk, and Sanchez and McLouth singled to make it 4-3. Zambrano then walked Jason Bay to load the bases before Adam LaRoche chased him with an RBI single off his glove that tied it. Nady then made it 5-4 with a sacrifice fly to foul territory in right off Michael Wuertz, before Doug Mientkiewicz lined a double play to first baseman Derrek Lee.
Besides struggling on the mound, Zambrano popped out while trying to lay down a bunt in the second and broke his bat over his left leg after striking out in the fourth.
"My team is in first place and I have a good record," said Zambrano, who's still 6-1 after being charged with a season-high five runs on seven hits. "What do I have to be frustrated?"
- The Cubs were not sure how serious LHP Rich Hill's back injury was after it stiffened during Friday's start for Triple-A Iowa. Sent to the minors two weeks ago because of control problems, Hill allowed three runs and walked three batters in 2 2/3 innings at Round Rock.
- Manager Lou Piniella said the Cubs will call up 1B Micah Hoffpauir before Monday's game at Houston, after Daryle Ward goes on the disabled list with a bulging disc in his lower back. Ward was available to pinch hit.