This was called "controlled crying" when we did it, and it worked a treat on our first and, as far as I can recall, wasn't necessary for our second (yes, lucky!). It was surprisingly quickly effective, maybe a week. Recommended.
I do remember that quite sharp 'parental pain' (it's hard to describe, it's like an intrinsic 'hunger to help') of knowing that we have to get through the next X minutes of baby crying without going in there. It's good to have a supportive partner so you can both keep each other in check (or to put it how I'd prefer: "well, we're both bad parents if this doesn't work, it's not just me").