The 20-year-old star said she couldn't believe that she was given the opportunity to write the track for the heartthrob.
The song is called Mouth2Mouth and will be featured on Iglesias' album Euphoria, which is due out in November.
Speaking through an audio link on her Twitter page, she said: 'Happy Friday guys, it's me Diana. I just wanted to say hey, and you may have seen on Twitter that I've got some very exciting news today.
'I've co-written the new Enrique Inglesias single featuring JLo, a.k.a Jennifer Lopez. I'm really excited about that.
'I was actually in LA and I co-wrote it with the lovely Gillian Beneta and we had loads of fun doing it.
'And I feel a bit of a happy babe today knowing that everyone's hearing it. And I hope you all like it and woo hoo I'm going to be celebrating all day.'