There actually is a way - a real way, not an empty platitude - but you may not like it.
Have someone from the development team involved in the sales process.
Now obviously you need someone with good people skills, someone whom the sales people aren't going to be mortified about taking along for the ride. And this person needs to have a broad understanding of the kinds of work that you do. They don't need to be a code ninja, they just need a mild understanding of coding in general and your development process in particular, and be reasonably good at estimating work.
This is really a job for a business analyst or project manager. There's a reason these jobs pay so well at many companies; they combine two very important and distinct skill sets. If you don't have a real BA or PM but have a senior dev or architect with social skills, they can do it too.
You also need to provide clear guidelines for the sales people. Effectively, you (as in your dev team) are sending someone to negotiate on your behalf. If you don't give them any parameters, they'll just negotiate what seems good to them. That's why you always give them parameters.
Once you understand the project scope, work out how much time you would like to have for building, testing, scope changes, and so on, plus a certain amount of buffer, then give them that number along with an "authorized minimum" - the lowest they can possibly go before putting the project at grave risk. Expect them to undercut that number by a certain amount as well, so make your minimum a little higher than it really needs to be.
Rest assured that their management is doing the same thing. The sales manager does not want the sales associates selling unprofitable deals. They are walking into each negotiation with a range of numbers corresponding to the target profitability and minimum profitability.
You may not be their managers, but if you document all of this in writing before they even start to negotiate, then you're on much firmer ground with upper management when people start asking questions about why the project is behind schedule. But it's not just about CYA; the sales team honestly does not have any clue how long certain things will take, and you're doing them a favour by giving them comprehensive information.
One other thing: Don't expect the sales team to get your team involved just for the hell of it. You need buy-in from the sales manager and executives, too. It really shouldn't be too hard to get, if you approach it from a risk perspective. You don't want to sell failure, do you? Think of the cost to the company's reputation. Think of the cost of a lawsuit. Someone technical must be part of any negotiation before any deal can be signed.
And if you really, honestly cannot sell management on the idea, then might I suggest finding a new employer? Because yours may not be around much longer anyway.