"I was worried, but I had to pretend like I wasn't," Maroon 5's lead singer told PEOPLE on Saturday at the movie's premiere, which closed the 2014 Tribeca Film Festival.
"So I was just playing the role of an actor knowing what he was doing. You know when you see a bear you have to pretend you are bigger than the bear in order to keep your life? That's kind of what it was like. I kept thinking, 'I'm an actor. For this next two weeks, I am an actor.' I crossed my fingers and hoped it turned out fine."
It did, according to Knightley, 29, who plays his heartbroken, aspiring singer/songwriter ex-girlfriend. "He's a born entertainer," she tells PEOPLE. "He's an absolute natural actor. The thing about musicians is that they are very confident. I can't imagine many of them asking for advice."
Like Levine, who made his TV acting debut in American Horror Story but had never been in a feature film before, Knightley had to break out of her own comfort zone when she had to sing throughout the film.
"I was pretty terrified," says Knightley (who once sang in The Edge of Love). "I'm not a singer. I think we faked it all right, which is what I was hoping for."
When she told Levine (who plays her songwriter ex-boyfriend who skyrockets to fame) about her jitters, "He went, 'You'll be all right,' " she says. "So every time he'd go, 'Oh, no. I'm really terrified. I'm acting for the first time,' I was like, 'You'll be all right.' He was really good – so I was right!"
Levine, 35, says he's grateful that he was able to work with Knightley. "I told her today, 'Thank you for being so talented so that you would make me look that much better.' I didn't know what I was walking into and it turned out I was walking into the most loving, supportive group of people. They respected me and I appreciated that considering what I was doing I had so much respect for."
The film opens July 4.