LJUBLJANA, Slovenia — By finishing first in national elections in Slovenia on Sunday, the hard-liner Janez Jansa has ridden a right-wing populist wave into power in yet another European country. Among those he can thank is Viktor Orban, the Hungarian prime minister, who campaigned at his side and darkly warned that the election was about “the survival of the Slovenian nation.”

Mr. Orban has become a right-wing hero with his blunt attacks against liberal democracy. Yet if his support was important, so, too, was the help of Mr. Orban’s friends.

In the past two years, Hungarian businessmen close to Mr. Orban have quietly invested in, or started, a handful of right-wing media outlets in Slovenia and in Macedonia. One, Skandal24, a sensationalist gossip magazine, took aim at some of Mr. Jansa’s opponents with salacious, thinly sourced articles. Another, the television channel Nova24TV, ran alarmist reports about migrants — and also got an “exclusive” interview with Mr. Orban in May.

“Jansa is exactly the kind of leader Slovenia needs,” Mr. Orban told Nova24TV.

As they gather strength across Europe, populist parties are proving adept at manipulating the media to push their messages and attack mainstream parties. In Italy, the anti-establishment Five Star Movement is now part of a new coalition government, despite being accused of using a misinformation campaign to discredit opponents. In Austria, the far-right Freedom Party has long used its television channel, FPÖ TV, to spread its message and build its base.