For a graph \( G \), the first Zagreb index is defined as the sum of the squares of the vertex degrees, while the second Zagreb index is the sum of the products of the degrees of adjacent vertices. The aim of this paper is to completely characterize \(n\)-vertex trees with given \(k\geq 1\) vertices that have a fixed maximum degree \(\Delta \geq 3\) with respect to the maximal and minimal Zagreb indices. Furthermore, our results provide detailed insights into the structure of extremal trees and are equally applicable to the class of chemical trees.