Pena has hit seven home runs since Boston traded him to Washington on Aug. 17. He had only five homers before the deal.
"I was waiting just for the opportunity to play every day," Pena said. "Now I feel comfortable and I can see the pitches much better."
Hill (4-3) gave up one earned run and six hits, walking none and striking out four to win for the first time since May 11. He did not return after a 40-minute rain delay in the top of the seventh.
Chad Cordero pitched the ninth for his 33rd save in 41 chances.
The victory gave fourth-place Washington a four-game lead ahead of last place Florida in the National League East.
"All the projections we're supposed to lose a hundred games, all that kind of stuff ... to be able to not only do what we're doing and also not finish last in our division is an accomplishment we can build on for next year," Hill said.
Scott Olsen (9-13) lost again, allowing four runs in five innings. He's 0-4 with a 7.39 ERA in six starts since beating Houston on Aug. 5.
"You go out there, you know you're not going anywhere," Olsen said. "You're just out there to play for the other 24 guys that are with you."
"As soon as he hit it I thought he had a chance, because I thought of Alex Gonzalez during the  World Series," Nationals manager Manny Acta said. "It was just a bullet."
Pena hit a solo shot in the fifth for his first multihomer game of the season and eighth of his career.
Uggla's 29th homer was a 443-foot drive into the second deck in left. Hill had retired nine straight Marlins before Uggla connected in the fourth.
The Marlins got an unearned run in the fifth when Lopez threw wildly to first on pinch-hitter Todd Linden's infield single to shortstop. The error allowed Ross to score from second.
Ryan Zimmerman's first-inning sacrifice fly drove in Logan.
Uggla's home run gave Florida a team-record 183 for the season. The Marlins hit 182 last year. ... The Nationals won the season series against Florida. The last time the franchise did it was 1998 when Montreal went 7-5 against the Marlins. ... The announced crowd was 12,345, though only several hundred remained after the rain delay.