The deal 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.
The deal is worth an estimated 300 times what the top-earning boss in the US made last year.
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.
“It will be interesting to see if another court is willing to credit a vote taken after the trial court’s decision.”
The eye-popping sum had sparked criticism and raised concerns that the board of Tesla was too submissive and close to Mr Musk.
In the January court ruling, external, Delaware 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”.
Chancellor McCormick had pointed out that Antonio Gracias, who had been a board director at Tesla, had “the sort of personal relationship that had him vacationing with Musk’s family on a regular basis”.
She also highlighted Todd Maron, Tesla’s former general counsel, “who was Musk’s former divorce attorney and whose admiration for Musk moved him to tears during his deposition”.
Mr Musk announced that he wanted to move the firm’s legal headquarters to Texas after the court 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 – the equivalent to a 10% stake in the firm – as a reward for Tesla meeting a number of goals set out in 2018 which are linked to sales, profits and the share price.