Barker stormed to the points race title in a race dominated by the home nations, with Katie Archibald and Neah Evans riding to silver and bronze respectively for Scotland.
Elinor's victory meant she became the first Welsh cyclist to win a Commonwealth title on the track since Auckland 1990.
She gained a lap on the field to finish on 40 points, winning two of the 10 sprints.
"I consider this to be one of my best events. I wanted to win and I'm glad it paid off," she said.
"It's really special and to hear the Welsh national anthem on the podium is something that doesn't happen very often.
"I'm so, so grateful."
The 23-year-old had won silver at the Glasgow Games four years ago.
Jess Roberts and Dani Rowe also represented Wales in the Points race, supporting their team mate and securing 12th place and 14th positions.
Meanwhile, in the Men's Blind and Visually Impaired Sprint Final, it was a battle of the home countries for gold. James Ball and Pete Mitchell won their second silver medal of this year's games, beaten by Scotlands Neil Fachie and Matt Rotherham.
Catch up on live tweets from the final two days of track cycling on Twitter @Welshcycling.