You're highly discouraged from trying to use an engine from a different year, model, or even slightly different trim level of the 3.4L without extensive research and likely custom fabrication. The risk of issues far outweighs any potential benefit.
Your best bet for a replacement engine is a used or remanufactured 3.4L V6 from a similar year Chevy Venture, Oldsmobile Silhouette, Pontiac Montana, or even a Buick Regal/Century (though the last two are less ideal). These engines have the highest chance of being a direct bolt-in replacement with minimal modification, if any.
Before purchasing any used engine, verify the engine code (often stamped on a block surface) to ensure it's a suitable match. A reputable parts supplier can help you find a compatible engine.