My Ex-Life, by Stephen McCauley, is a wry, endearing and often very funny novel about a long-divorced couple, David Hedges and Julie Fiske, whose paths converge again decades after they last spoke.

Both are reeling from more recent breakups, but Julie’s yet-to-be-finalized second divorce also threatens her ownership of the beloved antique house where she lives with her unmotivated teenage daughter, Mandy. Airbnb rentals are helping make ends meet, but her guests pose further challenges for the pot-smoking single mom.

David, who came out as gay after he and Julie divorced, is an independent college admissions counselor with heartache-related real estate woes of his own. His ex-lover has paired up with another man who’s angling to buy the home David rents in San Francisco.

Set on Cape Ann, the northernmost limit of Massachusetts Bay, the story takes place chiefly in two towns Mr. McCauley has named Beauport and Hammond—actually Rockport and Gloucester.

Renaming the communities “gave me a little bit more freedom in imagining the streets and the houses and the locations in ways that served the plot,” Mr. McCauley said.

My Ex-Life also has a Vineyard connection. Early in the process of writing the novel—his ninth, including two yoga-themed novels published under the pseudonym Rain Mitchell—Mr. McCauley spent two weeks working on it at the Noepe writers’ retreat in Edgartown established by Justin Ahren.

“I felt as if I was on a different planet,” Mr. McCauley said. “It was so spectacularly beautiful, I couldn’t believe I was 75 miles from Boston.”

A co-director, with poet Elizabeth Bradfield, of the creative writing program at Brandeis University, Mr. McCauley grew up in Woburn, “at the end of the period of time in which there were pig farms and leather tannery factories still active in town,” he said.

He attended the University of Vermont and later worked as a travel agent while pursuing a master’s degree in writing at Columbia University. Mr. McCauley’s graduate thesis was his first novel, The Object of My Affection, which in 1998 was made into a film starring Jennifer Aniston and scripted by playwright Wendy Wasserstein.

My Ex-Life is also being developed for the screen. “It was purchased for an ongoing TV series by John Wells,” who’s best known as the showrunner for ER, The West Wing and Shameless, Mr. McCauley said.

Along with teaching and licensing his novels, Mr. McCauley also owns properties that he rents to short-term visitors. He also travels and rents short-term himself, and he’s made use of his experiences in My Ex-Life. One of the funniest passages in the novel is dominated by a bibulous blogger-consultant named Sandra, engaged by Julie to coach her on Airbnb hosting—which, according to Sandra, requires high piles of toss pillows, lots of hand sanitizer and special measures to keep visiting couples from engaging in noisy sex.

“It’s a huge problem nationwide. You’re letting people into your space,” she tells Julie, through fumes of gin. “I’m doing a post on it soon, all the ways you can make your home as inappropriate for sexual activity as possible, to discourage people before it starts. Heavy valances and window curtains, potpourris in the bedrooms, floral slipcovers on the chairs, quilted bedspreads.”

Minor characters like Sandra “in some ways are the most fun to write,” Mr. McCauley said. “I had read up about Airbnb consultants, and I kind of exaggerated some of the characteristics of Airbnb hosts I have met.”

Although My Ex-Life has its dark moments—Mandy’s older friend has a creepy plan, and Julie is keeping a devastating secret—it’s a lighthearted novel with affectionately drawn characters who, for the most part, mean well.

“I was writing the book—not exclusively, but to a great extent—in the spring, summer and fall of 2016, during the height of the presidential election,” Mr. McCauley said.

“The more volatile the public discourse got, I think, the more generous and kind my characters got. I just sort of wanted to create a world in which people were taking care of each other, not for venal reasons, but because they cared about each other and wanted to do the best for each other.”

On Saturday, August 3 at 10 a.m., Stephen McCauley will take part in a panel called Fiction: Transformative Friendships. On Sunday, August 4 at 9 a.m., he will participate in a discussion with Elizabeth Benedict.