The musicians recorded "Ebony and Ivory" together in 1981. It was a hit when released the following year, but not popular with critics.
The Daily Telegraph reported their new song "Only Our Hearts" was recorded at Capitol Studios in Los Angeles late last year and will appear on McCartney's album "Kisses on the Bottom," which is set for release next month.
McCartney recently said his producer Tommy LiPuma suggested he work again with Wonder.
"We had this song, 'Only Our Hearts,' which is very '30s to '40s genre, that I'd written on purpose to be in that style," the Telegraph quoted McCartney as saying. "The producer said, 'What about Stevie?' And I was like, 'Wow.' It was a bit in left field. He agreed to come along, I met him after recording all those years ago, I've seen him off and on, but to record with him, we hadn't done it in a while. But he's such a genius."