A = Niche related, loWer DA ( 15-20 )
B = Not related but higher DA (25-40)
Which one is better
For this type of question, only google knows, and all we can do is guess.
You said (15-20) and (25-40), these are very wide ranges of possible DA, you could have:
- 15 vs 40 in which case B probably wins,
- or 20 vs 25 in which case A probably wins.
Also are you getting a homepage link, probably not? So the difference in DA changes once we get internal pages, and PA is to be considered, not DA. So what are the PA going to be? PA of a new page is 1, is it a new page, how long will it take to know PA? In other words just giving a DA is not enough, where is the link?
What we know is DA is correlated to the strength of a domain, and we also know relevancy is correlated to the strength of a link. So clearly this is a tradeoff and it is a matter of your personal beliefs.
More recently top SEOs are saying relevancy in links is getting big, so yes choose relevancy usually (A), but this is not a 100% rule.
And as some may add (I said it first), DA is only 1 metric among many to determine the strength of a link, so there are many other things to look at. And yes relevancy is one of the main things to look at.