I played a tennis match against a friend but lost.
Literal
Friend [with-と] tennis [possessive-の] match [object-を] did [but-が] lost.
が here is the contrastive conjunction 'but,' linking two clauses — not the subject marker が. テニスの試合をする ('to play/have a tennis match') is a standard noun+する pattern. 負ける keeps its core meaning of 'to lose, be defeated.'