NEW YORK -- Marlins manager Edwin Rodriguez tweaked the lineup and it worked.
Florida slugger Hanley Ramirez wasn't as fortunate with his hair.
Ramirez, back in the No. 3 spot, had four hits and Alex Sanabia won his second consecutive start since he was recalled from the minors as Florida held off the New York Mets 5-4 on Wednesday night.
"It was a big win for us. What I thought was awesome was how everybody just picked up everybody else," Dan Uggla said.
Before the game, Rodriguez moved Ramirez from the leadoff spot to his familiar No. 3 hole, where he's excelled as a run producer in the past.
Sporting a colorful new hairstyle, the All-Star shortstop responded -- and new leadoff man Cameron Maybin had two hits as well.
"Nothing different. I've done it before," Ramirez said, then pointed at Rodriguez as he walked by. "He's the man right there."
Earlier in the day, Ramirez tried to dye his dark hair blonde -- but it didn't quite turn out that way. His short, curly locks wound up a reddish-orange rust color after the salon experiment in his hotel room.
"Hanley told me he did that because he's going to be en fuego [on fire] the next five weeks," Rodriguez said.
Logan Morrison added three hits and scored twice on his 23rd birthday with his cancer-stricken father in the stands. Gaby Sanchez had a pair of sacrifice flies to back Sanabia (3-1), who took a two-hitter into the seventh inning.
With the bases loaded in the ninth, Leo Nunez retired Jose Reyes on a game-ending groundout.
"I didn't hit it very hard," Reyes said. "I'm going to take one strike at least from him, but he threw the first one right down the middle so I had to be a little more aggressive."
Ike Davis' first career triple and an RBI single by Jeff Francoeur cut it to 5-3 in the seventh and chased Sanabia, who allowed one run in 7 2/3 innings last Thursday at Pittsburgh.
Jose Veras escaped further damage and Clay Hensley worked a perfect eighth before handing a two-run lead to Nunez, who got through a shaky ninth for his 29th save in 36 chances.
Nunez gave up David Wright's leadoff homer and consecutive one-out singles to Francoeur and Josh Thole. Pinch-hitter Mike Hessman grounded into a force play at second, beating the relay to first, and Luis Castillo walked to load the bases.
Reyes, who finished 0 for 5, bounced a grounder to Sanchez at first base and he shoveled to Nunez covering for the final out.
"We put some good at-bats together late. It was a good thing, but it would have been better to get another hit there to win the game," Wright said.
Maybin had the first of three straight singles to begin the game against Pat Misch (0-3). After a force play at the plate, Sanchez delivered a sacrifice fly.
The rookie, who had four RBI in Tuesday night's loss, has knocked in at least one run in six consecutive games. He has 13 RBI during that span.
Maybin hit an RBI single with two outs in the second, but his error in center field allowed the Mets to cut it to 2-1 in the bottom half.
Ramirez singled in the third, stole second and went to third on Thole's throwing error before scoring on Sanchez's second sacrifice fly.
Brett Hayes had a two-out RBI double in the sixth and Morrison tripled in the seventh before Ramirez singled to make it 5-1.
Morrison's 51-year-old father, Tom, was diagnosed with inoperable lung cancer in April and, unable to fly, took a 29-hour train ride from Louisiana to New York this week to see his son play big league ballgames in person for the first time. He was joined by about 20 other family members and friends, who greeted the rookie in a corridor before heading out for a postgame dinner.
"Anytime he's in the stands I kick it up a little bit. He's the reason I'm here," Morrison said. "And with him being sick, there might not be too many more opportunities where he can see me play."
Marlins RHP Ricky Nolasco (torn meniscus in right knee) threw a bullpen session but wasn't able to take fielding drills because of a wet surface. The team wants Nolasco to show he can field his position effectively before determining whether he'll start Saturday night in Atlanta. Nolasco skipped his turn Sunday. ... Sanabia threw 46 of his first 60 pitches for strikes through six innings. ... Florida improved to an NL-best 26-12 against left-handed starters. ... Maybin made his second error in two nights since he was recalled from the minors. ... Mets rookie 2B Ruben Tejada is 1 for 34 since he was recalled from Triple-A Buffalo on Aug. 7 for his third stint with the big league club. ... The Mets threw out three runners at the plate.