When the singer-songwriter Sara Bareilles came to New York from her native California in 2013 and rented what she described as “a really sweet one-bedroom” in the West Village, who knew — certainly not Ms. Bareilles — that she’d soon be crooning a love song to the city?

“I was just testing the waters. I thought I would only be here for a year,” said Ms. Bareilles, 36, who composed the Tony-nominated score for the Broadway musical “Waitress” and is a five-time Grammy nominee in categories including song of the year and album of the year. She would have her New York adventure, she figured, then happily return to her life in Los Angeles and her house in the seaside neighborhood of Venice.

“And that didn’t happen,” she said. “I love the life that has blossomed here.”

But blossoming sometimes involves transplanting. That delightful place in the West Village was on the corner of Seventh Avenue and Christopher Street, “so it was very vibrant in the evenings,” Ms. Bareilles said. “In the beginning, it was sort of what I was seeking. But as time went on, it became clear to me that I needed a place that had a little more sense of sanctuary.”

She found just such a refuge, a two-bedroom rental in a loft-like space, several blocks east of her freshman apartment, on a street she’d wandered during an early visit to New York. “It was years ago,” Ms. Bareilles said. “But I remember this euphoric feeling of possibility and excitement and optimism. When my real estate broker showed me a place on that same street, it was a serendipitous moment. The stars were aligned.”