Shares of GoPro Inc. got a lift on Tuesday after the struggling action camera maker said it was partnering with extreme sports sponsor Red Bull in a marketing and promotion deal.

Briefly a Wall Street favorite following an initial public offering in 2014, GoPro's shares have fallen 82 percent in the past year as the company wrestles with weak demand for its helmet- and body-mounted cameras.

Its stock rallied 5.4 percent after GoPro unveiled the partnership, which makes GoPro the official point-of-view camera provider for Red Bull's events and videos. The two companies will produce content shown across both of their distribution networks and the deal gives Red Bull equity in GoPro.

The world's top seller of caffeinated energy drinks, Red Bull is a major sponsor of automobile racing, BMX, skateboarding and other sports in which athletes widely use GoPro's devices to record their often extreme accomplishments.

GoPro CEO Nick Woodman told CNBC that Red Bull's stake in the company was under 1 percent.

The Austrian drinks company shows its often-raw and edgy extreme sports videos through apps on the Apple TV, Alphabet's YouTube, Microsoft's Xbox and Sony's PlayStation.

"Historically, a ton of this stuff has probably already been filmed using GoPro cameras. My guess is we'll see more GoPro logos in those videos," said Dougherty & Company LLC analyst Charles Anderson, who has a "neutral" rating on GoPro's stock.

Demand for GoPro's cameras has been declining as rivals like China's Xiaomi offer cheaper products and smartphone cameras turn increasingly advanced.

The San Mateo, California, company's Hero Session camera released last year did not meet Wall Street's sales expectations and GoPro has yet to launch a new version of its higher-end Hero4 device released in 2014.

"They need a refresh badly. It's as if Apple went a year without a new iPhone," Anderson said.