2000 chevy malibu

my car overheated once completely now it lingers two notches before the H but doesn’t reach it. i bought the car used from someone who replaced the 3.1 with a 3.4 engine and began overheating the second day actually drove it. could it be the intake manifold gasket? if so would that have anything to do with the engine being replaced?