In this article, a new approach for output tracking of nonminimum-phase systems is proposed The proposed approach extends the preview-based stable inversion technique which utilizes the finite-previewed (in time) future desired trajectory to find the feedforward input (called inverse input) to achieve precision output-tracking of nonminimum-phase systems. It has been shown that the error in the inverse input can be rendered arbitrarily small provided the preview time is large enough - Exact-output-tracking can be achieved if the entire future desired trajectory is known (i.e., the preview time extends to infinity). Therefore, having a large enough preview time is important to ensure the precision in the preview-based inverse input. The available preview time can be increased by using more powerful sensors. Or, alternatively, the need for preview time can be reduced by redesigning the trajectory, the system, or by using path following techniques. However, the available preview time is limited by physical constraints in applications such as active noise control. More generally, the available preview time is limited because of the associated cost and/or hardware limit. Therefore, we propose, in this article, the integration of optimal control with the preview-based stable-inversion to optimally exploit the available preview time. Specifically, we aim at obtaining the optimal preview-based inverse input by minimizing, within the preview time window, the predicted tracking error (under the preview-based inverse input) over the input energy. The properties of the optimal preview-based stable-inversion are discussed.