Long Island’s football dominance over New York City came to an end last night in the Empire Challenge at Hofstra.

It took a herculean performance and a last-minute touchdown pass by one of the finest quarterbacks this game has seen in the 21 years of the all-star event.

New York quarterback Sharif Harris-Legree of Grand Street Campus completed 24 of 33 passes for an Empire Challenge record 371 yards and three scores in a thrilling 39-34 win over Long Island before an announced crowd of 7,145 at Shuart Stadium.

Long Island forged a 34-33 lead with 1:46 left and looked as if it would survive the Harris-Legree onslaught. But that wasn’t the case as he drove New York to the 19-yard line with 28 seconds remaining. Faced with a fourth-and-9, Legree lofted a perfect fade into the corner of the end zone over the outstretched arms of a defender to Jordan Hannah of Lincoln for the winning score with 22 seconds left.

The catch set off a wild celebration on the field and in the packed New York City stands.

Harris-Legree also scored on a 1-yard run to give New York a 33-27 lead with 5:16 left in the game. He added 39 yards on the ground.

advertisement | advertise on newsday

“That is one of the greatest performances we’ll ever see in this game,” said Pete Blieberg, the game’s director. “Wow, did he put on a show. His ball placement and touch was spectacular.”

The record-breaking performance also left many on the Long Island sideline impressed.

“He was finding lanes in the secondary and reading our coverages well,” said St. John the Baptist defensive back Jerome Brooks III, who had two tackles, a forced fumble and a pass breakup. “And their receivers ran excellent routes.”

The first half was an entertaining, back-and-forth affair. Huntington’s Infinite Tucker took an inside handoff and raced around the right end and followed a big block into the end zone for a 9-yard run to open the scoring. Plainedge’s record-breaking kicker Dylan Burns drilled the extra point to make it 7-0 with 4:53 left in the first.

Carey quarterback Mike Catanese, who earned the Long Island game MVP, keyed the drive with a 26-yard completion to Patchogue-Medford wide receiver Nico Morabito on fourth-and-4 to the New York 35.

Harris-Legree threw a 31-yard scoring pass to Adeola Oni of Port Richmond to make it 7-6.

Long Island, buoyed by a Jelani Greene 26-yard kickoff return to its 36, responded immediately. Newfield quarterback Ryan Klemm directed a nine-play, 64-yard drive in 5:42. A spectacular jumping catch by Greene at the 1 set up Garden City halfback Brian Haeffner for a short touchdown run, and Burns added the kick to make it 14-6 with 8:32 left in the half.

“We did that all season at Newfield,” Klemm said. “He’s so athletic, just amazing. I just have to get the ball out there to him and he does the rest.”

After Justin Covington of Cardinal Hayes scored on a 1-yard run to tie the score at 14, Cardinal Hayes wide receiver Raheem Wilson gave New York its first lead on the final play of the first half. He caught a 7-yard dart from Harris-Legree for the go-ahead score as time expired. Long Island stopped the two-point conversion run and trailed 20-14 at the half.

Long Island opened the second half with an eight-play, 71- yard touchdown drive. The march was capped with a little playground imagination. Faced with fourth-and-12 from the New York 22, Klemm fired a 5-yard pass to Syosset wide receiver Mike Elardo, who lateraled to Roosevelt halfback Jude Innocent, who ran 17 yards down the visitors’ sideline for the score. Burns’ kick clanked off the upright to keep the score tied at 20.

advertisement | advertise on newsday

Burns, who made his previous 64 extra-point kicks, had a Long Island-record 153 points in his career.

It was that kind of night for Long Island.