The centerpiece of Quentin Tarantino’s movie “Once Upon a Time … in Hollywood” is the production of a TV pilot called “Lancer,” in which B-actor Rick Dalton (Leonardo DiCaprio) is cast as the heavy opposite real-life Hollywood actor James Stacy, played by Timothy Olyphant, best known as the star of the modern-day Western “Justified” on FX.

Although DiCaprio’s character is fictitious, as is “Bounty Law,” the TV Western that made Dalton famous, “Lancer” was an actual Western that aired Tuesday nights at 7:30 for two seasons on CBS beginning in 1968. (In those days, that meant a total of 70 episodes.)

It was the story of a rancher, Murdoch Lancer (Andrew Duggan), who struggles to hang onto his San Joaquin Valley holdings with the help of his sons Scott (Wayne Maunder) and Johnny Madrid (Stacy), whose exotic name comes by way of his Mexican mother. The Maunder role is played in the movie by Luke Perry, in one of his last appearances.

In Tarantino’s film, Rick views the “Lancer” job as one more sign that his career is grinding to a halt.

In real-life, “Lancer” premiered at the tail end of the heyday of network TV Westerns such as NBC’s “Bonanza” and ABC’s “The Big Valley.” Guest stars on “Lancer” included the popular actors of the day, such as Stefanie Powers, whose NBC series, “The Girl From U.N.C.L.E.” is reference in the movie, and Cloris Leachman, who was bound for Emmy- and Oscar-winning glory a few years later, thanks to “The Mary Tyler Moore Show” and “The Last Picture Show.”

Only one “Lancer” guest star makes a cameo appearance in “Once Upon a Time….In Hollywood,” and that’s Bruce Dern. The Oscar-nominated actor (“Nebraska”) appears as George Spahn, owner of the Hollywood ranch where “Bonanza” was shot and the Manson family freeloaded. He appeared in two episodes of “Lancer,” a year apart.

When Dern, who replaced Burt Reynolds in the role after the actor’s death, read the “Once Upon a Time” script, at Tarantino’s house, the director queued up one of his “Lancer” episodes, bringing him back to his first days in Hollywood, when director Elia Kazan told him, “When you get out there you have to understand you’re not a leading man. You’re going to be the fifth cowboy from the right.”

Tarantino also showed Dern a scene he did on “The Big Valley” opposite Lee Majors, who played one of star Barbara Stanwyck’s sons. “He said it was the best 10-minute scene on television,” says Dern, 83.

Acting in Westerns was a living but so much more, he says.

“I didn’t realize Universal Pictures made 14 hours of television Westerns every week. If you died on the show, you could do a Western every year,” he says. “You could make a living doing nothing but Westerns.”

Even if he was the fifth cowboy from the right, the experience was invaluable.

“When I first came to Hollywood my generation had a privilege. We still had a chance to work with the legends. Nowadays there are no legends. No one has the privacy to be a legend anymore.”