Whether you can profit from this depends a lot on factors no-one here is privy to - such as the name, strength of mark, persons involved. etc etc etc, as outlined before
That's true of many questions asked here, since people like to believe that simple questions always have simple answers.
168's comments above are generally correct.
The question can be much broader than "when was the domain name registered" compared to "when was the trademark registered". While sometimes the situation is that simple, there can be additional facts which change the picture, and most of the discussions here at NP reflect an extremely simplistic view of trademark registration as the be-all and end-all of whether and when someone may have had a trademark claim. In the US and many other common law jurisdictions, a company can go for YEARS using a trademark, and having perfectly enforceable trademark rights before ever getting around to registering the trademark. If there is one thing I would like to pound into people's heads, it would be that.
Completely unanswered here is how long has the OP had the domain name, as opposed to how long the domain name has been registered. It's not clear to me that the OP's registration and use of the domain name pre-dates the mark.
Another thing absent from the facts here is what has the domain name been doing? Has it been doing the same thing the entire time?
There are situations where a UDRP panel will have no problem transferring a domain name on these facts:
1. Bob registers the domain name dogfood.tld in 2010. The domain is put on PPC, and the ads are for dog food.
2. Charlie starts a shoe company in 2012 and calls his shoes "Dog Food" brand shoes. He develops trademark rights and the shoes are wildly successful.
3. By 2014, the PPC results on the dogfood.tld start coming up with shoe advertisements.
4. In 2015, the renewal payment rolls around, and Bob renews the domain name. The PPC page continues to show shoe advertisements.
5. In 2016, Charlie files a UDRP against Bob.
On those facts, there are a good number of UDRP panelists who will transfer the domain name. While it is not a favored approach, they will argue that the 2015 renewal was a "new registration" of the domain name done in bad faith, because the domain name was at that time monetizing in relation to shoes, and not dog food.
That said, it is often the situation that the simple answer is the correct one, but belief in simple answers as if they are correct answers in all instances, can be hazardous.