The iPhone 5 doesn't seem to suffer from the issues the iPhone 5s is when it comes to inaccurate compass and level readings. The accelerometer for the iPhone 5 was supplied by STMicroelectronics. The iPhone 5s' part was revealed to be a Sensortech BMA220, which is made by Bosch.
It isn't so much that the supplier itself is the issue, but more that the tolerance levels and what each accelerometer is considering to be an acceptable 'zero-g offset'.
This is where we find the problem: the typical bias for the ST part is +/- 20mg, while the Bosch part lists +/-95mg. This almost 5x greater offset range is confirmed by our measurements, and is absolutely consistent with the failures being reported by users and the media.
According to RealityCap, the issue could be solved with software on Apple's part but for now individual developers can compensate inside their apps.
A fix from Apple would be the best solution since it would solve problems going forward in which developers don't compensate for the differences in tolerance levels. It will be interesting to see if Apple responds to the issues with a software update for the iPhone 5s.
Source: MacRumors via RealityCap