Justin Timberlake paid a visit to “The Tonight Show Starring Jimmy Fallon” on Wednesday, and the two wasted no time breaking into the sixth installment of “History of Rap” — complete with a tribute to NWA’s “Straight Outta Compton,” which Fallon attributed to the success of the hip-hop group’s biopic, which has been a surprise smash for Universal at the box office this summer.

“Jimmy, we’ve been through this before — you are not Straight Outta Compton, you are Straight Outta Upstate New York,” Timberlake gently told his companion.

Earlier in the day, the duo flexed their musical muscles in a different way when they were spotted dancing to Beyonce’s “Single Ladies” in the stands at the U.S. Open during Roger Federer’s quarterfinals match with Richard Gasquet.

Among the other songs included in Fallon and Timberlake’s medley were R. Kelly & Jay Z’s “Fiesta,” LL Cool J’s “Rock the Bells, Salt-N-Pepa’s sultry “Let’s Talk About Sex,” MC Hammer’s classic “U Can’t Touch This,” DJ Jazzy Jeff & The Fresh Prince’s “Summertime” and newer offerings, such as Chris Brown’s “Look at Me Now,” Kendrick Lamar’s “B—- Don’t Kill My Vibe” and Drake’s “Know Yourself,” before they capped things off with the Beastie Boys’ “Fight For Your Right.”

Timberlake later judged a lip-sync battle between Fallon and his other guest for the night, Ellen DeGeneres. Fallon kicked things off with The Killers’ “Mr. Brightside,” before DeGeneres fired back with Diana Ross’ “Do You Know Where You’re Going To?”

Not to be outdone, Fallon responded with Silento’s “Watch Me,” complete with energetic dance moves, but DeGeneres was prepared with Rihanna’s “B—- Better Have My Money,” after which she dropped the mic. Naturally, Timberlake then declared DeGeneres the winner of the contest.