In 2002, several years before “Brokeback Mountain” controversially lost at the Oscars, a movie about similar taboos opened in Israel.

In “Yossi & Jagger,” the closeted cowboys of the Hollywood film are foreshadowed by a similarly secret affair — a relationship between gay Israeli soldiers serving near the border with Lebanon. Originally made for television, the movie was so good, it was released in theaters, earning prizes at film festivals around the world and gathering a devoted following for Eytan Fox, its talented writer and director.

A decade later, fans of the film were incredulous when Fox announced he’d be trotting out one of the characters for a sequel — a project that at best seemed unnecessary, and perhaps would even tarnish memories of the earlier film.

Eytan Fox (photo credit: CC-BY-David Shankbone/Wikipedia Commons)

Eytan Fox (photo credit: CC-BY-David Shankbone/Wikipedia Commons)

That, happily, proves not to be the outcome in “Yossi,” opening Friday in New York and Feb. 1 in Los Angeles.

Nearly a year after premiering at the Tribeca Film Festival — where it received a nomination for best narrative film — the movie marks a welcome return for its title character, although viewers don’t need to have seen the previous installment.

The film contrasts Israeli culture, which has changed since 2002, and the repressed Yossi, who hasn’t

Just like in the real world, a decade has passed in the life of Yossi (Ohad Knoller), now a doctor in the Tel Aviv area. The more inhibited lover in “Yossi & Jagger,” the character remains mostly closeted, awkwardly dealing with a nurse’s crush while continuing to pine for his old flame, whose absence is explained early in the film.

The doctor’s unease with himself has taken a toll — 10 years after losing his great love, he’s packed on serious weight, and generally looks the worse for wear. Fox and Knoller effectively convey the character’s loneliness, subjecting him to a mortifying, aborted online hookup before sending the doctor on an unplanned trip to Eilat. (Internet dating tip: As a courtesy to your fellow daters, and ultimately for your own dignity, don’t post photos of yourself that are more than a couple years old.)

Unexpectedly placed on leave from his job, Yossi heads south — to a vacation spot, yes, but also to a place as distant geographically as the character is emotionally.

It’s en route to his hotel that Yossi encounters the man who sets the film in motion — a soldier named Tom who’s on a short military leave with his buddies.

As Fox did in the earlier film, he’s cast one of the biggest stars on Israeli TV as Yossi’s love interest — in this case, the heterosexual heartthrob Oz Zehavi, who demonstrates an unexpected sensitivity and depth.

While Tom fits in perfectly with his loud, occasionally boorish fellow soldiers, the character also stands apart in subtle ways — differences that Yossi discerns as they make their way to (lucky coincidence) the same hotel.

As is inevitably the case in sequels, “Yossi” takes place partly on familiar ground. Like Jagger in the first film, Tom is the more open, carefree member of the duo, generally happy and silly, but also capable of real intensity. It makes sense that Yossi would fall for both of them — people are often attracted to a certain type.

But the similarities serve an additional purpose, highlighting a contrast between Israeli culture, which has changed since 2002, and the repressed Yossi, who hasn’t.

Whereas both lovers in the earlier film remained largely in the closet, Tom and his friends are at ease with his identity — so much so that his sexuality passes largely without comment. By contrast, Yossi, still only in his 30s, is already a relic, locked in a self-imposed prison even as he watches others live freely.

Internet dating tip to spare your dignity: Don’t post photos that are more than a couple years old

It’s a subtle but powerful observation by Fox, noting the speed with which social rules are changing, as well as the difficulties that many — including some gay men themselves — are experiencing as they try to keep up.

Cultural and political observations aside, “Yossi” stands on its own purely as entertainment, filled with engaging, well-acted scenes and characters.

In fact, beyond the gay themes, viewers may notice that the film’s romantic elements aren’t so different from more traditional cinematic love stories, reflecting certain fantasies common in works by male directors — especially those who, like Fox, have reached middle age.

From the businessman in “Pretty Woman” to every Woody Allen role ever, filmmakers at a certain stage of life seem fixated on a particular kind of protagonist — an older, not necessarily attractive man inadequately loved or appreciated by the world around him.

Like those characters, what Yossi really needs — at least in Fox’s eyes — is a patient, sympathetic young lover: someone who understands his idiosyncrasies, adores him anyway and is (what are the odds?) smoking hot.

Straight or gay, American or Israeli, certain types of wishful thinking turn out to be universal.