Pulling off a “Glee”-inspired opening number to this year’s Emmy Awards, “Late Night With Jimmy Fallon” exec producer Mike Shoemaker admits he now owes a lot of favors.

The opening — which featured Emmy host Fallon and several “Glee” cast members (as well as Jon Hamm, Tina Fey, Betty White, Kate Gosselin, Joel McHale, Jorge Garcia and Nina Dobrev) — earned raves from crix.

But it wasn’t easy to pull off.

“This was one of the first things we wanted to do,” said Shoemaker.

The first step: Getting the “Glee” stars — including Jane Lynch, Lea Michele, Chris Colfer, Cory Monteith and Amber Riley — on board. After “Glee” exec producer Ryan Murphy signed off, the seed was planted.

Then, the tough part: Getting the rights to Bruce Springsteen’s “Born to Run,” which Fallon wanted to sing as part of the opener.

Enter Emmycast exec producer Don Mischer, a vet of music shows. A few calls later, Springsteen had given his OK.

“That was a big moment,” said “Late Night” scribe Amy Ozols, who helped mastermind the opening.

Fallon later headed to Capitol Records, where he recorded his vocal tracks for “Born to Run” in Studio A, the legendary studio where Frank Sinatra once recorded.

Adding to the surreal factor, former Journey frontman Steve Perry happened to be there, and wound up giving Fallon some vocal coaching.

Then came the recruitment of others. For starters, Hamm and Fey are “friends of the show.” And Shoemaker admits he now owes a lot to the pair.

Shooting began late Friday, after folks like Fey finally made it to town. The producers had the run of the Nokia Theatre, and they utilized much of it.

Filming continued on Saturday even as Friday’s shoots were being edited.

Fallon, Shoemaker and the “Late Night” team that traveled to Los Angeles worked non-stop Friday and Saturday to make it happen.

Choreographer and Pussycat Dolls founder Robin Antin was brought in to whip the actors into shape. For much of Saturday, the performers rehearsed the live-action portion of their song-and-dance routine.

“Jon Hamm sounds awesome, Jorge Garcia sounds awesome. The stars just aligned to do this,” Shoemaker said.