Doctors said Oshin Kiszko should undergo chemotherapy and radiotherapy to treat his malignant brain tumour.
But his parents, Angela Kiszko and Adrian Strachan, refused treatment because of the severe side effects.
After a court decided in March that Oshin had to receive chemotherapy, a judge in September ruled he could be given palliative care.
The Perth boy died early on Wednesday morning, his mother confirmed to local media.
"My love Oshin took his last breaths peacefully as I lay cuddling him at 2am," Ms Kiszko told Seven News.
"Oshin's journey has been extraordinarily traumatising for him and I am grateful he no longer needs to suffer through this nightmare."
The legal fight began after Oshin underwent brain surgery at Perth's Princess Margaret Hospital in December 2015.
Doctors recommended follow-up chemotherapy and radiotherapy, but Oshin's parents believed the side effects would ruin his quality of life.
"I thought I could not put myself through it. Why could I put my son through it?" Ms Kiszko told Nine's 60 Minutes programme in April.
Doctors took the matter to the West Australian Family Court, which ruled in March that Oshin must undergo chemotherapy.
At a hearing in May, the court heard evidence that the boy would have at least a 30% chance of survival if he received both chemotherapy and radiotherapy.
The matter was adjourned when Ms Kiszko and Mr Strachan committed to continuing chemotherapy only.
In September, a judge ruled Oshin's cancer was so advanced he could be given palliative care.
A court statement at the time said "specialist medical opinion confirmed that the delay in therapy had substantially reduced Oshin's chances of a cure, which are now remote".

Chilton, 24, drove for two seasons in F1 with Marussia before losing his seat in 2015 after the team was re-branded as Manor Marussia.
He competed in Le Mans 24 Hours in 2015 and last season raced in America's Indy Lights series, winning once.
Chilton said: "In the last three years I haven't had a car that can get a podium. This year I have no excuses."
New Zealander Scott Dixon won last year's IndyCar drivers' championship with Chip Ganassi.
Chilton, who will drive a Chevrolet, will become the fourth British driver in the last 24 years, after Nigel Mansell, Mark Blundell and Justin Wilson, to join IndyCar full-time after competing in F1 in the same capacity.
Wilson died at the age of 37 after being struck by flying debris and suffering a serious head injury in an IndyCar race in Pennsylvania last August.
Chilton made 35 starts in F1 across the 2013 and 2014 seasons and set a new driver's record of 25 consecutive finishes, with 19 of them coming in his first season.
A six-year-old boy whose cancer diagnosis sparked a high-profile legal battle in Australia has died.
[NEXT_CONCEPT]
Former British Formula 1 driver Max Chilton will join Chip Ganassi Racing for the 2016 IndyCar season.