Paramedics were called to attend a sudden death at Joe's Bar in Dungiven at 06:00 BST on 6 October 2014, Limavady Magistrates Court was told.
Police arriving a short time later found several people still at the bar.
Till receipts showed alcohol was being served as late as 04:49 BST. The judge ordered its closure for three months.
Colleen O'Neill, 43, of Kevin Lynch Park in the town, was charged with two counts of allowing the consumption of liquor outside licensing hours.
James Thomas, 44, of the same address, faced one count of the same charge.
A defence solicitor told the court that the licensing laws in Dungiven "were not strictly adhered to".
He said it was clear that the premises had not been run in a proper manner and had been running well into the morning.
The judge said Ms O'Neill, who is the license holder, had "an appalling record" and expressed concern that he did not have power to impose a custodial sentence.
"This was as bad a case as I have come across and as bad a record," he said.
Ms O'Neill was also fined £3,000, while Mr Thomas was fined £1,000.

26 April 2017 Last updated at 08:41 BST
Well actually they do - and treasure has been found in pretty unexpected places.
Whitney's had a look at some of the biggest hauls.

The band have revealed they were asked to write a signature tune for the movie, but it "didn't work out" and the song was not used.
Sam Smith's Writing's On The Wall ended up as the movie's theme song instead.
Radiohead have now made their brooding, orchestral song, titled Spectre, available as a free download on Soundcloud.
Singer Thom Yorke wrote on Twitter: "Last year we were asked to write a theme tune for the Bond movie Spectre.
"Yes we were. It didn't work out, but became something of our own, which we love very much.
"As the year closes we thought you might like to hear it. Merry Christmas. May the force be with you."
Many fans expressed their approval on Twitter. Music critic Pete Paphides was among them, writing: "It sounds exquisite on first listen, sensational string arrangement."
Before Spectre came out in October, there had been speculation that Radiohead had been chosen for the coveted task of recording the theme tune.
In July, one bookmaker suspended betting on the identity of the act that had recorded the theme after one punter tried to bet Â£15,000 on Radiohead.
Bond actor Daniel Craig is known to be a fan of the band, having quizzed Yorke for Interview magazine in 2013.
Sam Smith's theme received mixed reviews when it was released in September, with BBC entertainment correspondent Colin Paterson saying it was "good enough, but not a classic".
But former Bond actor Sir Roger Moore called Writing's On the Wall "very haunting and wonderfully orchestrated".
The song made history by becoming the first Bond theme to reach number one in the UK, achieving combined chart sales and streams of 70,000 copies.
Smith was the first solo male British act to perform a Bond film's theme song since 1964, when Tom Jones was heard over the opening credits of Thunderball.

At the trial in the town of Douai, the prosecution had asked for an 18-year term for Dominique Cottrez, 51.
The defence had argued that the former health worker should be acquitted because of her troubled mental state.
Cottrez earlier confessed to suffocating her children after giving birth secretly at home near Lille.
She then buried the bodies in the garden of her parents' home and at her own home nearby in Villers-au-Tertre.
The former nursing assistant had previously said she had a long incestuous relationship with her father and that she feared each baby might be his.
However, during the trial she did not talk about the relationship.
Cottrez, who is obese, also said that from a young age she had battled with her weight and was mocked by other children at school.
She apparently managed to conceal her pregnancies from everyone, including her doctor and her husband, because of her obesity.
A sudden death at a pub in County Londonderry alerted police to alcohol being served hours after closing time, a court has heard.
[NEXT_CONCEPT]
You might have heard of pirates finding treasure - but real people don't find it anymore, right?
[NEXT_CONCEPT]
Radiohead have released the song they recorded to be the theme for the latest James Bond movie Spectre.
[NEXT_CONCEPT]
A court in northern France has sentenced a woman to nine years in prison for killing eight of her newborn babies between 1989 and 2000.