Justin Bieber will take a DNA test in two weeks when he returns to the United States to prove he is not Mariah Yeater's baby daddy -- and after that, Justin and his team are going after her in court ... sources directly connected with Justin tell TMZ.

Justin is in Europe now so he can't take the test until he returns ... but he is determined to put an end to what he says is a bogus scandal.

Our sources say Justin's lawyer, Howard Weitzman, contacted Yeater's attorneys Friday and conveyed the DNA test WILL happen. We're told Justin and his team are so serious ... they directed Weitzman to find a lab to do the test and Weitzman has already selected one.

Once the test shows Justin is not the daddy, Justin and his team will sue her. We're told Yeater's lawyers appeared "nervous" when they heard the news. This may explain why Yeater's lawyers went underground yesterday and did not return TMZ's calls.