Britney Spears has released a previously unheard track which was co-written by Justin Timberlake while they were dating.