John Pierotti hunkers down at a worktable behind the needlework shop owned by his wife, Orla, and flips through a series of cartoons mounted on cardboard.

"I don't know why they are suing me," complains Pierotti, a short, chunky cartoonist who looks like a sea captain in his pastal blue turtleneck, slacks and short-billed cap. "I've been drawing cartoons for 50 years -- and governors, mayors and presidents have never taken me to court."

But a couple of Brigantine real estate agents, contending that he hurt their reputations and their busineses last year when he drew -- and had published -- some cartoons criticizing the sale of a beachfront lot near his house. Their lawyer calls it libel. Pierotti denies he libeled anyone; besides, he aruges, his cartoons are covered by the First Amendment guarantee of free speech. His lawyer calls it a permissable expression of political ideas.

And so the battle lines are drawn.

It is all somewhat ironic. Pierotti, 69, as bald as Kojak under that captain's cap, sometimes heard yelps of protest from targets of his barbs during the 20 years he spent as editorial cartoonist for The New York Post. But it is only now, after he packed up his many awards and retired to the peaceful, wave-washed community of Brigantine, far from the political wars, that he gets sued -- because of a backyard battle over a 90-foot-by-80-foot plot of sand.

Not that it is a frivolous fight. The Atlantic County Board of Realtors is on the side of the two real estate agents, while the National Cartoonists Society has come to the defense of its former president.

Nor is the struggle over the dunes a frivolous one. It pits the rights of property owners who stand to lose valuable beachfront land against the need of a community to protect the dunes -- the only defense it has against the rambunctious sea.

The residents of Brigantine, whose population Pierotti estimates to be 8,000 in winter and 30,000 in summer, know how precarious beachfront living can be. In 1962, a hurricane slammed into the island north of Atlantic City, slicing it into pieces and demolishing many vacation homes. After the beaches and dunes were restored, a local ordinance was passed forbidding anyone to alter the dunes without specific approval of the three city commissioners.

The current brouhaha began about a year ago when Walker-Rogge, a local real estate firm, sold a beachfront lot to a Pennsylvania couple for $100,000. Neighbors were incensed.

Their main argument was that the land was covered by a dune. Clearing away that 14-foot mountain of sand to build, they asserted, would make the island more vulnerable to flooding and would jeopardize their federally subsidized flood insurance.

What made residents even more furious was the John Rogge, who as mayor was a member of the commission that had to approve the building on the dune, also stood to gain by the sale since he was a partner in the firm that made the transaction. That, they felt, represented a blatant conflict of interest. t

Two of the bitterest opponents were Pierotti and Richard Walborn, who live next to the plot. The new house will go up between Walborn's gray bungalow and the ocean, only a few feet from his porch, and it will block the view from Pierotti's kitchen.

"I am fighting for my view," explains Orla Pierotti, motioning in the direction of the dunes from her kitchen window. She was just as opposed to the sale as her husband was.

They used every means they could to block the building but to no avail. Pierotti drew cartoons and had them printed in Gilbert Panter's Brigantine Shoppers Guide, which has a circulation of about 7,000. Fifteen appeared between April and October, along with a blank form inserted and paid for by Walborn, asking readers to join a protest group. All the attempts failed to stop the building.

Now, the bespectacled cartoonist guides visitors on a tour of the site -- just out his back door beyond his boat and his camper. As he sucks on his corncob pipe, he points out the concrete foundation of the new house and the sand that was scraped from the back half of the lot and dumped on the ocean side of the dune. They lost the battle, Pierotti now concedes, but he contends that they won the war.

About 700 people backed an effort to ban further building on the dunes, and the commissioners have since passed a tougher law, making it virtually impossible for anyone to build on the dunes.

Rogge, who resigned as mayor in October because of what he said was his wife's health problems, denies that there was anything improper about his conduct -- a stand supportee by other Realtors and the board.

Then there is the libel suit filed by Morris Goldsmith, attorney for the Atlantic County Board of Realtors, in the name of members Ned Carrier and John Risso. The realtors were upset by Pierotti's cartoons, such as the one that depicted a giant hand, representing "A Realtor's Greed," ripping out a chunk of land, labeled "Sale of Brigantine's Dunes for Housing," and another showing a stamp marked "The City Commissioners" in the back pocket of a figure stamped, "A Realtor's Greed."

At first, Goldsmith wroter Pierotti and Walborn demanding "an apology -- a sincere-sounding apology -- for the libel you have committed. With these stupid cartoons, you have maligned the entire profession of real estate persons in this area."

When no apology appeared, he filed the suit (for unspecified punitive damages), arguing that the cartoons implied that Realtors were crooked. His lawyer declared, "There are many ways of bringing home to the public the inadvisability of selling off the dunes. He doesn't have to call professional men -- honorable men -- crooks. That is horrible."

Pierotti was not left to fend by himself.

The National Cartoonists Society, its board of governors and its entire commmittee inserted an ad in three papers circulated in Brigantine "in support of our fellow cartoonist and past president, John Pierotti, in his right to freely express his feelings in the matter of the Brigantine Dunes Affair."

"Those who have brought suit against our valued and esteemed colleague," the ad said, "should be reminded that the First Amendment of the United States Constitution guarantees the right of expression by word or by cartoon."