No, it is not okay to put a guinea pig in with a gerbil.
They have different dietary needs—guinea pigs are herbivores while gerbils are omnivores. They have different social structures, with guinea pigs being social and gerbils more solitary. Guinea pigs are significantly larger and stronger, which could injure or stress a gerbil. They also have different housing needs and can transmit different diseases to each other.
It is highly recommended to keep guinea pigs and gerbils in separate cages for the safety and health of both animals.