What do you supose would happen if the IRS knew that you gave somebody a $10 million house as a birthday present? Do you think it would be any different than cash or any other gift worth $10 million? As TTech noted, it's all about the value of the gift. Most of the time, if you give somebody a lottery ticket as a gift the IRS is probably willing to consider that at the time you made the gift the ticket's value was only it's cost.
OTOH, if you buy a MM ticket for the 12/24 drawing this year (when the cash jackpot could be 4 to 5 hundred million bucks), the value of the ticket is $1 only until the drawing is held at 11PM. After that it's worth either nothing or the value of whatever prize it has won. If you give that ticket to somebody (other than your spouse or a charity, when a gift tax would never apply) as a Christmas present, when was the gift made? If you deliver the gift (even leaving it under the tree might qualify) before the drawing you've got a very persuasive argument that the gift was given when the ticket had a value of $1. If you take it to your sister's house on Christmas morning and give it to somebody, is that when the gift was made?
In reality, the IRS will probably believe that you didn't give somebody a gift knowing that it's worth millions of dollars unless that person is very important to you, so they'll probably accept that the gift was made when you purchased it with the intent of giving it as a gift. That the person you gave it to will probably be cooperative about paying income tax on the value of the prize certainly helps. The IRS isn't quite as bad as people sometimes think, so as long as somebody pays income tax on it they probably won't bother arguing over the details of when the gift was made.
Now suppose the recipient claims the gift was already worth millions of dollars and says that as a gift they aren't required to pay income taxes on it? At the very least, the IRS is going to expect somebody to pay income taxes. Will they also try to collect a gift tax from the person who made the gift?
I'm fairly sure there's never been a court ruling on something like the scenario presented by the OP, but if somebody gives a lottery ticket to stranger after the value of the ticket is known to be millions of dollars, I don't see much in the way of a valid argument that the gift is taxable income to the recipient. Even if the person bought the ticket with the intention of giving it away, they can't gift it to a stranger until they've at least met the stranger. Perhaps it would come down to constructive receipt. If the gift is made between the time of the drawing and the time a lottery claim center opens (plus reasonable travel time?), there may be an argument that since the person making the gift could not possibly have claimed the prize yet, then the ticket is not worth milions yet, and the gift is therefore at the purchase price. There's a less persuasive argument that the time it would take for the lottery to make payment, or even the 60 day period to decide between cash and annuity would determine the value of the gift.
Of course if anybody wants to give me a jackpot winning ticket an hour after the drawing I'd be happy to help them with getting a definitive court ruling.