If your camera supported custom tone curves, you'd be able to get a similar result to this straight out of camera. Unfortunately, yours doesn't, so your only option is post-processing.
There are many ways one would get this effect in post.
Basic levels adjustment - put the black point output as a value above 0 using a levels control or similar in Photoshop, other editors, or your RAW software.
Use a curves control and have the leftmost point of the curve not go all the way down to the bottom axis.
Use a gradient map, and choose your off-white and off-blockblack colors as the gradient. This would offer the flexibility of giving a color cast, and also letting your black point and white point have slightly different color casts.