The song was titled "I Never Heard," and Jackson and Anka are credited as co-authors on an early 1990s version recorded by the singer Sa-Fire.
RELATED LINK: Listen to Michael Jackson's version of "This is It"
RELATED LINK: Listen to Sa-Fire's version, called "I Never Heard"
Anka said Jackson's estate moved quickly to give him credit, promising Anka 50 percent of the song's profits.
"They did the right thing," Anka said. "I don't think that anybody tried to do the wrong thing. It was an honest mistake."
The string-backed ballad was released on the singer's official Web site and sent to radio stations. It gives advance publicity to the documentary, culled from footage of Jackson rehearsing for the concerts that he never got a chance to do.
Representatives of Jackson's estate acknowledged Anka's work in a prepared statement. Until Anka stepped forward, the song's history was a mystery.
"The song was picked because the lyrics were appropriate because of the name Michael gave his tour," the statement read. "We are thrilled to present this song in Michael's voice for the first time, and that Michael's fans have responded in unprecedented numbers."
Anka, 68, initially contemplated legal action after being informed Monday by outlets such as the New York Times and TMZ of the similarities between "This Is It" and the Sa-Fire version. But later in the day, he said he was satisfied with how the situation was handled.
"There's nothing but honorable people here," said Anka, a former teen idol from the 1950s and '60s who sang "Put Your Head on My Shoulder" and wrote "She's A Lady", one of Tom Jones' biggest hits.
Sony Music Entertainment had said it wasn't sure when Jackson recorded the song but speculated it could have been around the time Jackson's "Off the Wall" album was done 30 years ago.
Close - Anka said it was recorded right around the time Jackson's "Thriller" album was becoming a smash hit.
"This Is It" was apparently found in a box of tapes with only Jackson's voice and a piano accompaniment.
Strings were added to the bare-bones recording, along with backing vocals from Jackson's brothers. Other touches included finger-click percussion that echoes Jackson's recording of "The Girl Is Mine."
The preparation of "This Is It" is eerily similar to how the surviving Beatles took outtakes from John Lennon following his murder and added their voices and instruments to craft the "Real Love" and "Free As a Bird" songs released as part of the "Anthology" project in 1996.
"This is it," Jackson sings to open the song. "Here I stand. I'm the light of the world. I feel grand."
Sony says it was a coincidence that his upcoming concert series was also titled "This Is It"; the company has no evidence that Jackson himself had planned to release the song.
Posthumous releases follow a long-standing pattern in popular music dating back to Elvis Presley's death in 1977.
Presley's records have continued selling since then, with new greatest hit compilations and live concert releases finding huge new audiences. His estate still receives tens of millions of dollars each year from CD sales and other enterprises, and in 2002 he even topped the UK charts with a remixed version of an older song.
The same was true, to a lesser extent, after the deaths of rock icons such as Jimi Hendrix, Jim Morrison and Janis Joplin. A number of Lennon solo albums were also released in the years following his shooting death in 1980.
Some artists have scored major hits after their deaths. For example, "Time in a Bottle" was the No. 1 hit in early 1974, months after Jim Croce died. Otis Redding's biggest hit, "The Dock of the Bay," was released after his death in a plane crash in December 1967. "Me and Bobby McGee" made the charts in 1971, a year after Joplin died.
It probably won't be the last time music fans hear something new from Jackson. Tommy Mottola, former chairman and CEO of Sony Music, told The Associated Press shortly after Jackson died in Los Angeles June 25 that there are "dozens and dozens of songs" that did not make the pop star's albums, along with more recently recorded material.
Questions about who owns the material and differing opinions among people who control Jackson's estate could complicate the release of these songs, said Rob Levine, executive editor of Billboard.
Making "This Is It" available online before putting CDs on sale might seem counterintuitive. But several artists do it - the Flaming Lips streamed their entire new album online - and Web sites such as myspacemusic.com offer streams of many songs.
Jackson's company is betting that interest generated from early release of the song will spur purchases of the album. More so than many artists, Jackson fans are more inclined to buy CDs than seek out digital copies of his music, Levine said.
"This is aimed at passionate Michael Jackson fans and people who want to participate in a historical event," he said. "In both cases, people are going to want something to hold in their hands."
The two-CD set offers previously released versions of Jackson hits coinciding with the order they are presented on the DVD. Besides "This Is It," the other new material is a spoken-word poem and demo versions of "She's Out of My Life," "Wanna Be Startin' Somethin"' and "Beat It."
Jackson, one of the most commercially successful artists of all time, is expected to sell millions of albums in the coming years. His death already brought some of his classic records back to the top of the charts.
His death at age 50 is still being investigated.
The Los Angeles County coroner has ruled Jackson's death was caused by acute intoxication by the anesthetic propofol, with other sedatives a contributing factor. The coroner found the powerful anesthetic was administered without any medical need and that recommended resuscitation equipment was missing.
Associated Press Writers David Bauder, Gregory Katz and Mesfin Fekadu contributed to this report.