The singer admitted that a number of guest features were suggested for the track, which features on her retrospective LP Dance Again... the Hits.
She told MTV: "Why Flo Rida? You know, we thought about it and [it] was like, 'Who should we get? Should we get Big Sean or Flo Rida?' All these names come up.
"I just think that the style of the song really fit [Flo Rida]. It was half-dance, but half kind of hard too, you know, and I just felt like he was the perfect one."
Meanwhile, Rida said that it was an "honour" to be included on the song, adding: "I'm a big fan of JLo. Her people reached out to me. It was just an honour to get a call from JLo.
"[I'm a] big fan of her film work and her musical talent, and we did the collaboration ASAP. When JLo heard the verse, immediately, even some friends that I know that know her, called me up and was just like, 'Yo, man, you killed the verse'."
Watch Lopez's 'Goin' In' music video below: