Crispian Mills's film stars Pegg as tormented novelist Jack, whose research into Victorian serial killers has transformed him into a paranoid wreck.
Speaking to Digital Spy, Pegg said that he relished the chance to return to a more intimate scale, joking that the film's one-man-show tone appealed because he's "a massive egomaniac".
"It was nice to come back and make a film more on a scale like Shaun of the Dead," he said. "There are benefits to both – I've just finished the second Star Trek and that was enormous fun because it was so huge.
"This was fun because it was very intimate, and it felt like we were making it against the odds, kind of."
Of preparing for the film's rap-based sequences, Pegg explained: "I listened to a lot of NWA, a lot of Cube... Crispian sent me a whole bunch of stuff.
"I just buried myself in aggressive gangsta rap music, and thoroughly enjoyed it!"
A Fantastic Fear of Everything opens in UK cinemas tomorrow (June 8).