A pair of tipsy partiers tried to slide down a Chinatown building’s chimney, only to get trapped inside and need firefighters to rescue them out, authorities said.

The pair — Gregory Massuelle, 28, and Alexia Elodie, 25 — went to the roof of 17 Allen St. with the party host and third-floor building resident, to get a glimpse of New York’s sunrise, law enforcement source said.

By 7:30 a.m. they were ready to head back downstairs and the two guests inexplicably decided the best rpiote to the third floor was via the building’s chimney — which acts as the building’s steam vent, authorities said.

They dropped down only a few feet before they got stuck in the tiny space. The party’s host saw their plight from above and called for help.

Firefighters had to bust into a seventh-floor business — House of Marley, which sells Bob Marley memorabilia — to open a wall and rescue the drunken duo, officials said.

Elodie suffered some bruises, but refused medical attention.

Massuelle — a French-speaking man who was wearing blue jeans with no shirt — was taken to New York-Presbyterian/Lower Manhattan Hospital with minor injuries.

A nearby business owner watched part of the rescue in disbelief.

“They were just having too much fun last night,” he said.

The incident might get the hard-partying third-floor resident and building’s owner in trouble with the city’s Department of Buildings.

That’s because 17 Allen St. is zoned strictly for commercial use, and any evidence of residential living there could bring fines of between $2,500 and $12,000, a Department of Buildings rep said Saturday.

The agency will take a close at 17Allen St., looking or evidence of anyone living there.

“An inspector will make the determination on what conditions must be observed that would substantiate illegal residential occupancy,” a buildings department rep said.

A sign on the building’s ground floor warns: “No loitering on roof! Roof is for emergency exit only, no loitering is allowed on the roof. Violators will be subject to termination of the lease!”

The listed owner of 17 Allen St. — who lives in Manhasset, L.I. — and the partying. third-floor occupants could not be immediately reached for comment on Saturday.

The building had been investigated before for the same complaint, in 2011, but “inspectors didn’t find residential occupancy at the time,” the Department of Buildings rep said.

There’s been no probe or complaint about the building before this latest incident.

Additional reporting by Khristina Narizhnaya and David K. Li