The test, which looks for high activity in a gene called alpha beta crystallin, could help doctors plan better treatment for women with aggressive and deadly forms of the disease.
Researchers who studied almost 4,000 breast cancer patients found that those with the active gene were three times more likely to have cancer that had spread to the brain.
In a further analysis, alpha beta crystallin was also linked to a greater risk of death.
A quarter of participants who tested negative died within 10 years of their diagnosis compared with 36 per centre of those who tested positive.
Study co-leader Dr Maggie Cheang, from the Institute of Cancer Research in London, said: “Spread of breast cancer to the brain is unfortunately very dangerous, and usually leads to death within months.
“It’s important to find new ways to identify women who are most at risk of their cancer spreading to the brain, so that doctors can work out which women might need more intensive or new treatments to try to keep cancer at bay for longer.
“Our study linked a positive score in this test with quicker spread to the brain, and importantly showed the factor we were measuring is providing information on patient outcome independently of other biomarkers.”
The findings are published in the journal NPJ Breast Cancer.