It could be the gasket on the inlet manifold or maybe a leak in the pipe connecting the inlet manifold to the brake servo. When you press the brake pedal the vacuum in the inlet manifold, which sucks the petrol into the engine, is used to operate the brake servo and a leak in this system can cause uneven running. Check the condition of the pipe connecting the servo to the manifold and also check the connections at both ends are tight. If that looks OK it could be the gasket between the cylinder head and the inlet manifold leaking.