Both sides were involved in a frantic start to the match as Gareth Bale fired well over from 25 yards.
Joe Allen then had two efforts blocked as the Scotland defence stood firm in what was a ferocious atmosphere at the Cardiff City Stadium.
The hosts could have taken the lead soon after but Steve Morison's header somehow went wide from Bale's cross.
They were made to pay on 26 minutes as Morrison latched onto Steven Fletcher's flick on before firing past Lewis Price.
The home team refused to get their heads down despite going behind and pushed hard for an equaliser.
However, Allen and Ramsey both put their efforts wide of goal as Scotland held onto their lead going into the second half.