"Credit against" means the application of payment to a debt or obligation.
Let's suppose that you agree to buy a certain bottle of wine on your trip to France and sell it to an acquaintance for $100 when you get back to he US. You go France, buy the agree-upon bottle for the equivalent of $20 in euros, and when you return home, your acquaintance refuses to pay. He's now the Defaulting Party and you're the Non-defaulting party. You go to court and ask for payment. Since you have a valid contract, the court will agree with you, but for $80, not $100. The court will apply the value you've received ($20 in wine) to the agreed-up payment ($100), i.e., $100 - $20 = $80. "Against" means in the opposite direction, so from your point of view the $100 is a payment you're owed and the $20 reverses a fifth of that.
In the Wyoming legal case you cite, a man was convicted of sexual assault and got a minimum of 12 years and also convicted of burglary and got a minimum of 3 years for that, the sentences to be served concurrently, i.e., at the same time. In Wyoming, if you're arrested and convicted and you're too poor to post bond, the time you spend in jail awaiting trial is subtracted from your sentence. The convicted man spent 170 days in jail before being sentenced so his sentence was reduced by that number of days. In other words, his debt to society of at least 4380 days (12 years if we don't count leap days) in prison was reversed by 170 days, so we say he got a credit of 170 days against the minimum sentence of 4380 days.
(The man got the credit against the sentence for sexual assault, but he wanted the same credit applied to the sentence for burglary. The state argued that if didn't make any difference for concurrent sentences, but the court granted the man his seemingly-useless credit.)