If you're selling your New York apartment but for whatever reason you don't want to move out right away—your kids are finishing out the school year, say, or you need the cash from the sale to be able to buy a new place—don't despair. 

It's relatively common for sellers to negotiate what are called post-closing possession agreements, formal deals allowing them to stay in place for a set period of time under set conditions.

For some tips on how best to negotiate one of these, we turned to a real estate broker and an attorney who have negotiated a bunch in their day. Three or even six months of extra occupancy are somewhat common, they say, and a nine-month agreement isn't unheard of. Here are their pointers for how to get there.

Don't bring it up right away, but if there's serious interest, go for it

Your desire to stay in your apartment for a few months shouldn't be in the listing, or on the tip of your broker's tongue when she shows the place. Instead, it's something to broach when you get an expression of real interest, either after the first offer, or when it seems like a prospective buyer is definitely going to make one.

"You can bring it up when there’s substantive contact between you and the buyer or the buyer’s agent," says Brian Lewis, an agent at Compass. "That means they’re figuring out their offer plan. It’s important to always let a potential buyer know—not at an open house, when they’re first coming in the door, but when they’re interested—the seller’s priorities, to guide the buyer in how to put together the most enticing offer."

Selling an apartment is a give and take process, so be ready to negotiate, real estate lawyer Toby Cohen of the firm Holm & O'Hara advises.

"if you are going to request it in the middle of the transaction, be prepared to give up something," he says. That could mean covering some fee, taking care of some maintenance needs, or even lowering the price.

Lowering the price up front can drive interest, and won't necessarily cost you in the end

Setting your initial asking price at an amount that's high for the neighborhood runs you the risk of not being in the best position to negotiate when you do bring up wanting to stick around the apartment for a while. 

"If you price your home at a premium price and the market doesn't’ respond right away, you’re going to be attracting one offer, maybe two if you’re lucky, because you’re setting a new premium on your price," Lewis says. "Asking one buyer, 'Do you mind if I stay on as your tenant for three to five months after closing?' The one buyer is more apt to say no."

On the other hand, he continues, "If you can create a competitive situation for the seller, you can map out to all the bidders what the priority of the seller are. Aside from most qualified, least contingent, best financed, and if you're in a co-op, board passable buyer, [the seller's broker] could say, 'It’s not required but it would mean the world to my seller if you would let the seller stay for three to six months.'"

He gives the example of an apartment he says was worth around $3.2 million, which he priced at $2.75 million because the seller wanted to stay in place for six months. He says the under-pricing drew eight or nine offers in the first two weeks. 

Lewis says he told all the bidders, "The seller is looking for the best price, the least contingent, the most passable buyer. However, if anyone will agree to a six-month rent back only maintenance, that person would go to the front of the line." 

Because it was so competitive, one buyer upped the bid to $3.2 million and agreed to let the seller stay for six months for just the cost of the maintenance fee. 

Phrasing the temporary stay as a deal sweetener as opposed to a potential deal-breaker if you don't get it is important, Lewis explains, because even in a crowded environment, "sometimes nobody will rise to the occasion." Even so, someone who can't afford the time but has cash to spare may sense the urgency and up the ante financially, which hopefully will soften the sting of having to sublet or whatever it is you need to do to make stopgap arrangements.

Consider your audience

Cohen points out that developers who are planning to demolish the houses they're buying tend to care less about delays of a few months, whereas if a buyer is planning to move in right away, "that can mess up everyone's plans."

Consult with your lawyer 

If you're selling your place, you should have a lawyer anyhow, and that lawyer should have the expertise to draw up a post-sale possession agreement. 

"These are pretty straightforward," Cohen says.

He explains that the agreement typically takes the form of an amendment to the sale contract. Often the buyer puts a small portion of the sale price in escrow, to be received by the seller when she finally moves out. This would be spelled out in the agreement as well as the period of time that the seller is staying, what if anything she has to pay while she's there, and what she would have to pay if she overstayed the agreement, if that's something both sides want to include. 

A typical agreement will include a clause where the seller waives tenancy rights, so that she can't squat and claim to be a tenant. If she does, the buyer can take her to housing court and show the contract to the judge, which hopefully (for the buyer) would be the end of that.

Neither Cohen or Lewis has seen a possession agreement go sour once signed off on.

"If it's done by smart people and everybody has the same end goal in mind, and everybody’s a good player, there should be no problems," Lewis says.