The package was blocked earlier this year by a judge in Delaware over concerns it was unfair to shareholders.
The vote is a victory for the multi-billionaire, who had campaigned fiercely for the payout, which is worth up to $56bn (£43.9bn) - the exact amount depends on the Tesla share price.
"Hot damn, I love you guys," he told a crowd of enthusiastic shareholders who had gathered in Texas for the firm's annual meeting.
However, the vote is not binding and legal experts have said it is not clear if the court that blocked the deal will accept the re-vote and allow the company to restore the pay package.
"The vote changes nothing," said Mathieu Shapiro, a managing partner at law firm Obermayer Rebmann Maxwell & Hippel.
"It only offers Tesla opportunities to try to use the vote to obtain a better decision going forward," he added.
The eye-popping sum had sparked criticism and raised concerns that the board of the company was too submissive and close to Mr Musk.
Mr Musk announced that he wanted to move the firm's legal headquarters to Texas after a judge in Delaware, where it is currently incorporated, voided his pay package, siding with a small investor who had sued over the deal.
The fight over the plan had aired concerns about Mr Musk's leadership, at a time when Tesla's share price has fallen from its height and its position in the electric car industry is under pressure.
But Mr Musk rallied his fan base in support of the deal, appealing particularly to individual investors, who make up an unusually large portion of the firm's shareholder base.
"It's a pretty ringing endorsement," said car industry analyst Karl Brauer.
Mr Musk got more than enough shareholder support "to justify the package," he added.
The company did not immediately disclose the margin of the vote.
Mr Musk had previewed the results in a post on his social media company, X, formerly known as Twitter.
Shares in the company closed up nearly 3% after Mr Musk's announcement.
The compensation plan gives Mr Musk rights to roughly 300 million shares – a roughly 10% stake in the firm - as a reward for the firm meeting goals once considered unfeasible, like becoming a $650bn firm.
"My understanding is that there's been about 1,100% appreciation in Tesla stock. And that's pretty, pretty impressive. Most chief executives have never done anything like that," said Mr Brauer.
In the ruling earlier this year, Judge Kathaleen McCormick ruled the sum was "unfair" and the process for determining the package, by a board dominated by Mr Musk, was "deeply flawed".
Tesla called the decision "fundamentally unfair, and inconsistent with the will of the stockholders".
The company then submitted the deal to another vote - and asked its shareholders to back a plan to reincorporate the company outside the state of Delaware.
“It will be interesting to see if another court is willing to credit a vote taken after the trial court’s decision,” noted Mr Shapiro.
The board said Mr Musk deserved the package because Tesla achieved its ambitious targets under his leadership and that it was necessary to ensure he remains dedicated to the company.
Tesla executives also expressed support for the package in social media posts, saying that Mr Musk is crucial to the company's success.
Meanwhile, Mr Musk promised a personal tour of Tesla's factory in Texas to some shareholders who cast votes.
The package - worth an estimated 300 times what the top-earning boss in the US made last year - won backing from 73% of shareholders who voted six years ago.
Shareholders also approved the re-election of two board members at the meeting on Thursday: James Murdoch, the son of media tycoon Rupert Murdoch, and Mr Musk's brother Kimbal Musk.