"Nolasco was throwing the ball OK. He left a couple balls over the plate for home runs," manager Ozzie Guillen said. "We've got to get better offensively. ... We have to. We don't have any choice."
The home team, however, was not the only one to go yard. Facing Pirates starter Kevin Correia (7-6), Jose Reyes took the second pitch of the game and deposited it in the seats in right-center to give Miami a quick one-run edge.
The Marlins picked up another run in the frame when Emilio Bonifacio, after singling and stealing second and third, scored on a groundout by Carlos Lee.
"The game started very good for us," said Reyes, who finished 3-for-5 with a stolen base. "That's what we want to see on a daily basis."
The Pirates got a run back in the bottom of the first when Garrett Jones singled in Alex Presley, who had reached on a leadoff walk.
Miami added to its one-run lead in the top of the fourth, scoring on a one-out bunt by Nolasco with runners at the corners. But Nolasco surrendered two runs in the bottom of the frame, the first by Alvarez's dinger and the other on a run-scoring single by Clint Barmes. The previous batter, Rod Barajas, hit a ground-rule double to left field.
In the fifth inning, Nolasco gave up the home run to Walker, which broke the 3-3 tie.
"We're just a real resilient group," Walker said. "We feel we can come back no matter who is on the mound."
Nolasco left the game after six innings and 86 pitches. He struck out seven while walking just one. He gave up eight hits, and all four of his runs were earned. His ERA rose to 4.55.
"Ricky, he pitched OK. I mean, he gave up four runs," Guillen said. "But he gave the team a chance, and unfortunately, we didn't help him."
The Marlins rattled off 13 hits, only two of which went for extra bases -- Reyes' homer, and John Buck's double in the second.
"[Correia] pitched out of the stretch most of the game, but he was competitive," Pirates manager Clint Hurdle said. "He didn't have his best stuff, and they fouled off a lot to get up his pitch count, but he stayed away from big innings. They had a lot of extended at-bats, but he competed very professionally."
Although Reyes had three hits or more for just the fifth time this season, a ninth-inning strikeout with men on first and third had the shortstop kicking himself after the game.
"We had an opportunity there to at least tie the game, but we weren't able to. I mean, me, I wasn't able to put the ball in play in that situation," Reyes said. "So I don't feel very happy about that."
Hanley Ramirez, who wasn't in the starting lineup, made an appearance in the ninth inning, pinch-running for Austin Kearns. Earlier in the day, Ramirez checked in to a local hospital because his right hand -- injured when he punched a cooling fan on July 8 -- became infected after he didn't take prescribed antibiotics.
Following Reyes' strikeout, Ramirez stole second base, giving the Marlins two men in scoring position. But Bonifacio struck out swinging to end the game, giving Pirates closer Joel Hanrahan his 27th save.
On the night, Miami went 0-for-8 with runners in scoring position. The team's average in these situations during its current three-game losing streak is .043.
"We have to be better with people in scoring position," Guillen said. "It seems like they put pressure on themselves, chasing some bad pitches and trying to get it done. That's what I see."