“What are you: a cop or my father?”

“I’m both.”

This exchange between Robert De Niro and James Franco sums up the dynamic at work in “City by the Sea.” Because it places such an emphasis on the moral friction between key characters, the real life-inspired film is a cut above most Hollywood cop dramas.

De Niro plays Vincent LaMarca, a New York City cop who’s tried for years to suppress the memory of his father being sentenced to the electric chair for murder. The family woe has apparently trickled down to LaMarca’s own son Joey (Franco), a drug addict now living in the dilapidated town of Long Beach, N.Y. Â a place once known as the “city by the sea.”

Juggling a strained relationship with his ex-wife (Patti Lupone) and a blossoming one with his neighbor Michelle (Frances McDormand), LaMarca’s world is further complicated when Joey is accused of killing a street dealer. This event forces the detective to find the balance between his professional duties and his personal bonds.

Based on a 1997 Esquire article by the late Mike McAlary, “City by the Sea” does a serviceable job bringing the fascinating story of LaMarca to the screen. Sure, many elements spring solely from the mind of screenwriter Ken Hixon (“Inventing the Abbotts”). ln real life, LaMarca was already retired from the police force  not the investigating officer  when his son was accused of murder. Joey’s crime wasn’t actually in self-defense, rather a premeditated assault. And whole characters in the movie, such as Michelle and the ruthless drug kingpin Spyder (William Forsythe), are pure Hollywood.

However, the “sins of the father” lineage that the LaMarcas hail from is depicted verbatim. Ultimately, it’s this ingredient that maintains the most resonance even in a picture peppered with gritty cop cliches.

The frequent exchanges between De Niro and Franco (who was so convincing in the TV special “James Dean”) elevate the film beyond the one-dimensional nature of its marketing campaign. Those expecting to see a lot of shootouts better be ready to sit through a greater barrage of conversations.

Even though there are a few moments where Franco seems a little overmatched by his veteran co-star, he shows enough flashes of talent to announce he’s about one flick away from being an A-list star.

Also very affecting is the chemistry shared by De Niro and McDormand, who takes a potentially thankless girlfriend role and turns it into something memorable. A dinner scene the pair share in which he unveils to her the full scope of his turbulent history marks the film’s dramatic high point.

One aspect that works considerably well is the landscape rendered by Scottish director Michael Caton-Jones (“Rob Roy”). A once-thriving seaside amusement area now a shell of rundown boardwalks and edifices, the locale looks like Coney Island after “the Serbian army came through,” as De Niro describes it. The deglamorized atmosphere gives an air of authenticity to scenes that might otherwise play as typical TV cop fare.

The only time this setting doesn’t hold up is in a remarkably ill-executed intro. Here, a 1930s Victrola ditty plays on the soundtrack as images of the bygone Long Beach flash by in washed-out colors. This fades into a modern image of Franco walking along the beach with a guitar slung on his back (which he is attempting to sell for a fix), while the music is replaced by a contemporary blues tune.

Although it’s mercifully brief, it’s laugh-out-loud pretentious.

But what’s with all the goofy names that distinguish the junkie population in Long Beach: Spyder? Snake? Picasso? Joey Nova? These sound more like characters from an ultra-violent video game than people inhabiting a nonfiction drama.

The filmmakers should realize the only name that deserves to draw attention to itself is LaMarca.