PHILADELPHIA (Reuters) - Florida ace Josh Johnson got the better of Philadelphia's Roy Halladay with a 2-0 win on Thursday, the victory coming less than two weeks after the Phillies pitcher threw a perfect game in their first showdown.

When they met on May 29, Halladay tossed the second perfect game of the Major League Baseball season and spoiled an outing where Johnson gave up just one run through seven innings.

In the rematch, Johnson allowed three hits -- none after the third inning -- and retired the final 17 batters he faced to improve his record to 7-2 as the Marlins snapped a four-game losing skid.

"Last time I had to be perfect to beat him," Johnson told reporters. "We definitely needed it. We beat the best pitcher in the game and it could definitely help you going into the next series."

A bid for a repeat performance by Halladay was short-lived as Marlins lead-off hitter Chris Coghlan opened the game with a single and later came in to score on Jorge Cantu's sacrifice fly for the first run of the game.

"That was a big hit," Marlins second baseman Dan Uggla said. "For (Coghlan) to get that hit in the first inning, it's funny to say, but it kind of took the pressure off."

Uggla later capped a lengthy 12-pitch at-bat with a home run to extend the Marlins lead to 2-0 in the ninth inning against Danys Baez, who came on in relief of Halladay.

Johnson, who was replaced by Leo Nunez in the ninth inning, finished the game with five strikeouts and one walk, while Halladay (8-4) allowed one run on six hits and struck out eight in eight innings.

(Writing by Mike Mouat in Windsor, Ontario; Editing by John O'Brien)