Firmino netted in the 11th and 29th minutes to give the home side an ideal start.
Mohamadou Idrissou scored an away goal for the second division side in the 58th minute, but substitute Sven Schipplock added a third for Hoffenheim nine minutes later.
The return leg will take place on Monday.
Hoffenheim had needed a dramatic 2-1 win at Champions League finalists Borussia Dortmund on the last day of the regular season to give themselves a shot at the play-off and they were on the back foot early on.
Kaiserslautern, who have never beaten Hoffenheim in seven competitive matches, had the first chance after five minutes, but Hoffenheim goalkeeper Koen Casteels made a superb stop to deny Erwin Hoffer from 12 yards.
And the hosts grabbed the lead six minutes later, Sejad Salihovic sending in a free-kick from the right side to Firmino, who was quicker than his marker and easily struck home.
Hoffenheim doubled their lead when Kevin Volland fed a charging Andreas Beck, who crossed from the right to the far post for Firmino to convert.
Lautern had a chance three minutes before the break, but Hoffer's volley from eight yards was sliced over the bar.
The visitors were more clinical in the 58th minute and halved the deficit when Hoffenheim lost the ball in midfield, Alexander Baumjohann played in Idrissou and he rounded Casteels and to score.
Hoffenheim nearly scored a third three minutes later, but Stefan Thesker's header went just over the bar.
But number three did arrive in the 67th minute as Schipplock, who had only been brought on two minutes earlier, won the ball off Marc Torrejon, played a one-two with Firmino and then clipped his finish past Lautern keeper Tobias Sippel.
The hosts almost added a fourth soon after, but Fabian Johnson headed over from three yards.