The Dingwall side end a four-game losing slide to stun Dundee at Den Park and move out of the relegation play-off spot.