A gang from Newark’s South Side is hiding Vinnie Martine’s body in a restaurant freezer. Tony’s mad because Anthony Jr. got caught pranking another mobster. And a boss who’s trying to reform gets his mansion sprayed with bullets.

Remember that episode of The Sopranos? If you do, your memory’s playing tricks on you, because all these things happened on a 1979 episode of The Rockford Files — written by Sopranos creator David Chase.

Chase signed on to James Garner’s hugely popular NBC series in 1976 and remained until its premature conclusion midway through the sixth season in 1980, writing and/or producing nearly two-dozen shows. And Rockford’s penultimate installment was actually a backdoor pilot for what would have been a Chase-produced spin-off about New Jersey mobsters – nearly two decades before The Sopranos premiered on HBO.

Broadcast on December 14, 1979, Just a Coupla Guys is the story of a pair of loveable losers trying to make names for themselves. Because they’re from the Garden State, that means one thing: they gotta get mobbed up. Eugene Conigliaro (Greg Antonacci) is the stylish but malapropism-inclined brains (sort-of) of the duo, and Mickey Long (Gene Davis) is the dumb but genial brawn. The mostly useless pair of wiseguy wannabes operates from the back room of a deli – you might even call it a pork shop – in Newark, owned by Eugene’s hot-tempered Uncle Beppy (Simon Oakland, who played Tony Vincenzo on the Chase-penned Kolchak: the Night Stalker in 1974-75).

What does L.A.-based private eye Jim Rockford have to do with this? Not much, but since his name’s in the title, he has to show up.

Rockford flies to Newark at the request of a retired mob boss’ daughter (Lisa Bowman) only to have his rental car and luggage stolen upon arrival. This leaves the storytelling spotlight open for Eugene and Mickey, who can be seen as younger prototypes of Paulie (Tony Sircio) and Silvio (Steven Van Zandt), two of The Sopranos’ more memorable characters. But the similarities between Chase’s failed NBC pilot and his HBO series (which ran for six seasons and 86 episodes) don’t stop there.

In Just a Coupla Guys, Tony the mob boss (Antony Ponzini) is a doting father who also happens to be a killer. Anthony Jr. (Doug Tobey) is a good kid acting up to get his dad’s attention. Jean (Jennifer Rhodes) is the long-suffering mob wife, trapped in a suburban mansion. And Mr. Lombard (Gilbert Green), is an aging former boss who may or may not have lost his marbles. There’s even a Catholic priest (Arch Johnson), although he’s nowhere near as attractive as Father Phil, the clergyman who caught Carmela Soprano’s eye.

The shared character types between the two stories are striking, though not surprising, considering Chase was a Jersey boy who grew up watching classic gangster films. Unfortunately, the Coupla Guys he cast are (or at least, were, to put it mildly) not particularly engaging screen presences, a fact that’s painfully obvious when they share scenes with the charismatic Garner, who died on Saturday at age 86. And, while The Sopranos managed to balance light comedy with occasionally horrific violence, Just a Coupla Guys is dopey and contrived, meandering through 50 minutes like an endless sitcom with no punchlines. I kept waiting for the show to be rescued by a laugh track, which was not uncommon in hour-long dramedies of the era, like The Love Boat and Eight is Enough.

Ironically, Antonacci and Long had first appeared together a season earlier on Rockford, as harder-edged versions of the same characters. In The Jersey Bounce, also written by Chase, Eugene and Mickey are drug dealers who move in next door to Jim’s dad Rocky (Noah Beery Jr.), kill a guy, and frame Rockford for the crime – a fact which the P.I. conveniently forgets when he meets them again on the other side of the country in Just a Coupla Guys.

Sopranos DNA also runs through The Jersey Bounce, with a reference to Carmela, a bald guy named Artie, meta conversations about movie gangsters, and a character who says, “Bada-bing.” Antonacci, a native of New York’s Hell’s Kitchen, is more of a stereotypical cugine in the earlier episode, and far more menacing; he both wears a wife beater and beats his wife (actually his girlfriend, who’s played by Doney Oatman, better known as Felix’s daughter Edna on ABC’s The Odd Couple). A year later, Chase and series creator Stephen J. Cannell gave Antonacci a perm and a sweater vest, and forgot that Long’s character had been introduced cutting lines of coke. Sadly, the end result is like lukewarm ziti. Daily Variety called it “amateurish tedium” and NBC passed on the series, which is probably for the best.

To be clear: no network would never have allowed David Chase to do anything remotely resembling The Sopranos on primetime television in 1980. But Hill Street Blues was only a year away, and St. Elsewhere two, and with them (and others) came a new wave of primetime realism. If Chase had chosen to keep the lead characters in Just a Coupla Guys more anti-heroic, who knows what might have happened.

Best of all, the story has a happy ending. An older, wiser Chase gave us the The Sopranos in 1999, kicking off what is now widely considered to be The Second Golden Age of Television. And, nearly three decades after Just a Coupla Guys, Chase cast Greg Antonacci again – in The Sopranos. The then-60-year-old actor played Phil Leotardo’s underboss Butch “The Little Guy” DeConcini, the rival mobster who cuts the deal with Tony that saves his life in the series’ final episode. Considering that (SPOILER ALERT!) Phil meets his maker in the finale, it’s likely that Butch became the boss of the Lupertazzi crime family.

It may have taken him thirty years, but Eugene Conigliaro ended up on top after all.

The Rockford Files airs weekdays at 12 p.m. (ET) and Sundays at 6 p.m. on Me-TV. The entire series is streaming in HD on Netflix, and the seasons 1-3 are available (with commercials) on Hulu.