The two Baines men who enlisted in the 5th Alabama Regt. lived in Sumter County near Intercourse, where they appear on the 1860 census. Mathias Baines died of wounds on July 4, 1862, while Henry Baines survived the war.
I don't have a census record to identify the Matt Baine who served in Col. Baker's 1st Alabama-Mississippi-Tennessee Regt. (AKA 4th Confederate Regt.), nor can I place him in another Confederate command. If you have anything showing him as a member of the 37th Mississippi, I cannot confirm. There are several records for men named Bain or Baines in that command, but no one with a first name like Mathias or first initial 'M'.