Law, 24 and making his debut, scored twice inside 19 first-half minutes before Stjarnan levelled with two penalties – the second coming in stoppage time.
Former Chesterfield youth striker Law, signed from non-league Alfreton Town, broke the Stjarnan defensive line to finish well past the goalkeeper on both occasions early on.But the away side hit back 10 minutes before the break when Keith Lasley was adjudged to have handled the ball inside the area, and Olafur Karl Finsen stepped up to coolly slot home the resulting penalty.
The goal also came after hosts at Fir Park Motherwell had a decent shout for a penalty themselves when Simon Ramsden was bundled over in the box.
But Finsen stepped up to convert again at the death and give Stjarnan, who sit second in the Icelandic League after 11 unbeaten games, a great advantage heading back to their artificial pitch for the second leg.
Motherwell manager Stuart McCall said: "If we're honest, it could've been six all. Being 2-0 up, it's then a disappointing scoreline but we're by no means out of the game.
"Someone shouted from behind (the dugout) that we were 'playing nothing' but they were good players and I knew they'd create chances against us.
"We'd have been happy to have gone over there with any sort of victory; 2-1 we'd have been more than pleased. It's all to play for now."
Motherwell travel to Iceland for the second leg with Stjarnan next Thursday.