Why go for stalemate here? In a Daily Puzzle of the Chess.com app, playing as white the solution to the puzzle was as follows:

 [Title ""] 
 [SetUp "1"]
 [FEN "8/p1Q3bk/P2N2p/5p1p/7P/6q/8/7K w - - 0 1"]

 1. Qxg7 Kxg7 2.Nxf5+ gxf5


If I'm not wrong this is stalemate and therefore a tie. Isn't there a better solution?
Yes, you're right that this is a draw because of stalemate. There is no better solution; White is two pawns behind, his king is exposed, he can't profit from the pin on the bishop and he can't safely win the a7 pawn. Without this tactic, black could just push his f-pawn towards victory.