June 26 (Reuters) - Rivian Automotive surged 36% premarket on Wednesday after a $5 billion investment from Volkswagen offered the loss-making startup more firepower to scale production in a slowing electric-vehicle market.

The investment will also bolster Rivian's depleting cash reserves, further its target of becoming profitable on a gross margin basis later this year and help it compete better in a market dominated by Tesla.

"It's a big vote of confidence in the EV maker's prospects," said Susannah Streeter, head of money and markets at Hargreaves Lansdown.

"Joining forces in this way may also help lower the cost-per-vehicle and bolster defenses against the growing might of Chinese EV makers."

The news, however, came as a blow to auto parts and software supplier Aptiv as brokerage Piper Sandler said the deal, which will provide Volkswagen with Rivian's electrical architecture and software platforms, highlights the reducing reliance on third-party software in vehicles.

It also downgraded Aptiv to "underweight" from "neutral."

If Rivian's gains hold on Wednesday, the stock will add more than $4 billion to its market capitalization, after closing at $12 billion a day earlier. The stock had lost nearly half its value this year after the California-based EV maker said in February it does not expect to produce more vehicles in 2024.

It had scrapped previous deals to make electric vehicles and commercial vans under separate joint ventures with Detroit automaker Ford in 2021 and Mercedes Benz in 2022.

Volkswagen's investment will also provide Rivian the funding necessary to develop its less expensive and smaller R2 SUVs and its planned R3 crossovers, CEO RJ Scaringe told Reuters.

Rivian's R2 SUV, set to roll out in early 2026, will be priced starting at $45,000 and will compete with Tesla's best-selling Model Y compact SUV.

(Reporting by Akash Sriram in Bengaluru; Editing by Devika Syamnath)