Chelsea will be crowned champions if they are able to win at West Brom on Friday, while Boro drop back to the Championship after a single season's stay in the top flight.
Costa gave Chelsea a deserved lead after a dominant opening to the game, finishing off a fine pass from Cesc Fabregas, via a touch off Cesar Azpilicueta.
Within 10 minutes the Chelsea lead was doubled, Alonso stealing in at the back post to steer home his sixth league goal of the season thanks to a deflection from Brad Guzan's thigh.
The goalkeeper was nutmegged again by Matic, Fabregas supplying his 10th assist of the campaign for a record sixth different season, as Antonio Conte's men ran riot to register Chelsea's 300th Premier League home win.
A crushing triumph extends the Blues' series of successes against Boro to seven without conceding a single goal, as Steve Agnew's side were unable to cope with the quality of the champions-elect.
Chelsea almost took the lead in the second minute when a lovely lofted Fabregas pass picked out Alonso, but Guzan got enough on the wing-back's volley to deflect the ball on to the crossbar.
Fabregas - selected in place of injured Player of the Year winner N'Golo Kante - had Chelsea's next chance when Eden Hazard picked him out with a low cutback, but the Spaniard's placed strike fizzed wide of Guzan's right-hand post.
Costa felt he should have had a penalty after 20 minutes when George Friend brought him down, with Hazard's cross only needing a touch, but the striker would not be denied moments later.
Fabregas was given too much space to find Costa in the box and, following a touch from Azpilicueta, the Spain international centre-forward rolled a calm finish between Guzan's legs for his 20th league goal of the season.
Boro could not hold the champions-elect at bay and the second goal duly arrived after 34 minutes.
This time it was Azpilicueta who was left in the same pocket of space outside the area, with Alonso timing his run perfectly and exploiting slack Boro marking to finish through Guzan's legs.
The interval failed to stem the flow of chances, with Conte's men hitting the woodwork again immediately after the restart, Pedro firing a strike that clipped the crossbar.
Fabregas picked up his landmark assist after 64 minutes following patient approach play, flicking the ball up to Matic's chest, the midfielder controlling before firing home with Guzan beaten between his legs for the third time on the night.
Tottenham's loss at West Ham on Friday opened the door to Chelsea and their coronation as champions is now imminent, with Conte even able to give captain John Terry a cameo from the bench - to a rapturous reception - as he nears his departure from the club.
Key Opta stats:
- Chelsea have become the third club to win 300 Premier League home games, after Manchester United (347) and Arsenal (306).
- Middlesbrough have been relegated from the Premier League for the fourth time – no side has suffered the drop more often since its inception (level with Crystal Palace, Norwich City and Sunderland).
- Sunderland and Middlesbrough are the sixth pair of clubs to be relegated from the Premier League together on two separate occasions, last doing so in 1996-97.
- Diego Costa became the third player to score 20+ goals in a Premier League season for Chelsea on two occasions (Jimmy Floyd Hasselbaink in 2000-01 & 2001-02 and Didier Drogba in 2006-07 & 2009-10).
- Costa has also scored the opening goal of a Premier League game on seven occasions this season – no other player has done so more.
- Middlesbrough have failed to score in 11 Premier League away games this season, more than any other side in the division.
- Cesc Fabregas provided his 10th assist of the season – he's now had 10 or more assists in six different Premier League campaigns, more than any other player (Ryan Giggs and Wayne Rooney with five).
- Nemanja Matic has scored two goals in his last four games in all competitions for Chelsea, after a run of 36 without one.