Samarin produced a spectacular free skate to win with a total of 264.45 points, having also posted the highest score in Friday's short programme.
The 21-year-old, who took the European championships silver medal in Minsk earlier this year, saw off compatriot Aliev by 4.57 points.
"Even though it wasn't my best performance, I'm overwhelmed with emotions," Samarin, who booked a place in next month's Grand Prix Final in Turin with victory, said.
Figure Skating
Gilles and Poirier win gold at ISU Figure Skating Espoo Grand Prix
28/11/2022 AT 08:20
"There were mistakes, big mistakes and we'll work on it.
"But I'm glad to have qualified for the Grand Prix Final. That is not a bad result for the first half of the season."
Aliev's strong free skate to Simon and Garfunkel's "The Sound of Silence" earned 169.24 points, enough to secure second place ahead of Makar Ignatov.
Japanese star Uno's difficult season continued as he ended 12.21 points behind Samarin overall.
Figure Skating
‘Quad god’ Malinin takes gold at Grand Prix of Espoo
27/11/2022 AT 23:51
Figure Skating
Mihara and Malinin capitalise to win Espoo gold
26/11/2022 AT 20:28