The decisive inning ended up being the seventh, when each team posted four runs.
Milwaukee relied on the long ball against Tom Koehler, who was making his Major League debut. Weeks and Hart each had two-run homers in the inning, pushing the Brewers' lead to 6-1.
The Marlins stormed back with four runs in the seventh, with RBI singles from Greg Dobbs, Bryan Petersen and Donovan Solano.
The three straight RBI hits came off reliever Kameron Loe, who inherited two baserunners with no outs from starter Wily Peralta.
A key play came on Solano's single with the bases loaded to right field. Donnie Murphy, who was hit by a pitch, scored from third, and Dobbs rounded third and initially was waved home by third-base coach Joe Espada, who quickly reversed and gave the stop sign. As Dobbs retreated to third base, Petersen rounded second hard and had nearly reached third. Petersen ended up being tagged out.
"It was huge," Miami manager Ozzie Guillen said. "We found another way to lose. That's No. 935 ways we find to lose."
Rather than have the bases full and no outs and trailing by one, Miami had runners on the corners with one out down 6-4. Jim Henderson replaced Loe and surrendered a sacrifice fly to Jose Reyes, making it a one-run game.
"Aggressive mistake, I guess," Petersen said. "I think that was one of those kind of instinct plays in baseball, where you think one thing and another thing happened. Just an aggressive mistake. I feel like maybe those are OK, as opposed to being left on second and Dobber scores."
Guillen, a former third-base coach, didn't cast blame on anyone specifically.
"A lot of people out there think our third-base coach did a bad job," Guillen said. "I think he did a good job. It was zero outs. And on the other hand, I can't blame the player; maybe Dobber read the ball bad. Petey was maybe running with his head down. Everything that happened in that play, everything went wrong."
The Marlins were unable to get any closer as they dropped their second straight and fell to 2-6 on the homestand, which wraps up on Thursday afternoon.
The frustration of not being able to keep that seventh inning going pretty much exemplified the night.
"A lot of things happened there," Guillen said. "I was watching the ball. Obviously, when you run the bases, you have to see who is in front of you. When you run the bases, you have to see where's the play, and be aware and give the third-base coach a better effort. And the third-base coach should be aware of the rest.
"If you're going to point your finger at anybody, I can't. Because I think everything was wrong with that play, and not any particular people you can blame."
Suffering the tough loss was Nathan Eovaldi, who had a solid showing, giving up only a two-run homer to Weeks in five innings.
Weeks had his sixth career multi-homer game, and first since July 18, 2010, at Atlanta.
"I thought I had him on that 2-2 slider," Eovaldi said of the pitch that ran the count full to Weeks. "I was trying to go in with that fastball. I left it right over in the middle and elevated it too. His hands are so quick."
Peralta, 23, was making his first big league start and second appearance. He threw in relief on April 22. The highly touted prospect gave up three runs on five hits in six-plus innings.
Peralta was staked to a five-run lead by the Brewers' four-run seventh inning.
Koehler, a September callup, worked a perfect sixth inning, but the right-hander was tagged for four runs on the two homers in the seventh, providing a cushion the Marlins couldn't overcome.
"Those balls, man they were hit," Brewers manager Ron Roenicke said of Weeks' homers. "The good thing is he's really seeing the ball well. He's laying off that breaking ball down, and when he's doing that and you're an opposing pitcher, you're in trouble."