The X Factor champion will release the song, which is his first single proper, later this autumn.
'Run For Your Life' is the only track Cardle did not co-write for his debut album Letters.
Cardle told The Sun: "We had 99% of the album finished then the track came through from Gary.
"I'd been trying to write a song like that for a long, long time, probably five or six years. As soon as I heard it I just felt the song was mine. Lyrically it's about not being good enough for the person you're with."
He added: "I know exactly what that's like. I was nearly in tears recording the vocals. I'm proud that I've written a lot of the album but Gary is a genius as a writer - I couldn't pass it up."
Barlow, who will make his debut as an X Factor judge when the new series airs this Saturday, explained that he was more than happy for Cardle to record his song.
The Take That singer said: "I thought the song would be perfect for Matt and it really suits his vocals. He's a lovely chap and I thought he was great on the show, a real talent."
Cardle recently announced plans to release his debut album Letters on October 17.
> Matt Cardle is the new Coldplay and Snow Patrol, says Guy Chambers
Watch the music video for Matt Cardle's winner's single 'When We Collide' below: